Bug #11023: exec does not wait for completion of cmd
| From: | terry at advertwizard dot com | Date: | Tue, 22 May 2001 11:14:30 +0000 |
| Subject: | Bug #11023: exec does not wait for completion of cmd | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-56241@lists.php.net to get a copy of this message | ||
From: terry@advertwizard.com
Operating system: slackware 7
PHP version: 4.0.5
PHP Bug Type: *Function Specific
Bug description: exec does not wait for completion of cmd
$cmd = "mv " . SITES_IMP . "site_* " . DB_UPDATES;
exec($cmd);
$arr = array();
$cmd = "ls " . DB_UPDATES . " site_* | wc -l";
exec($cmd,$arr);
i am of the impression that code proceeding an exec cmd will not execute until the exec is finished
in the above instance, the "ls" exec is executing before the "mv" exec has
finished - when i know that 10 files have been moved, the "ls" exec returns 0 for a
"wc -l", when running the code again it returns the number of files correctly - have
placed sleeps between the commands and all works well
wondered if this is a bug in the exec cmd or my misunderstanding of its use
--
Edit Bug report at: http://bugs.php.net/?id=11023&edit=1