note 66795 added to function.system
| From: | dan at thecsl dot org | Date: | Mon, 29 May 2006 15:45:12 +0000 |
| Subject: | note 66795 added to function.system | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-112501@lists.php.net to get a copy of this message | ||
You probably want to check your system calls for errors. The convention is to return 0 for "no
error" which is the same as FALSE which can be confusing. You need to do something like:
<?php
$cmd = "/usr/bin/pngtopnm $png_file > $pnm_file";
system($cmd,$return_value);
($return_value == 0) or die("returned an error: $cmd");
?>
----
Server IP: 216.194.113.175
Probable Submitter: 66.92.77.160
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.system.php
Edit -- http://master.php.net/note/edit/66795
Del: integrated -- http://master.php.net/note/delete/66795/integrated
Del: useless -- http://master.php.net/note/delete/66795/useless
Del: bad code -- http://master.php.net/note/delete/66795/bad+code
Del: spam -- http://master.php.net/note/delete/66795/spam
Del: non-english -- http://master.php.net/note/delete/66795/non-english
Del: in docs -- http://master.php.net/note/delete/66795/in+docs
Del: other reasons-- http://master.php.net/note/delete/66795
Reject -- http://master.php.net/note/reject/66795
Search -- http://master.php.net/manage/user-notes.php