ID: 29612
User updated by: tom at bitworks dot de
Reported By: tom at bitworks dot de
Status: Open
Bug Type: *Directory/Filesystem functions
Operating System: Debian woody Apache/1.3.27 (Unix
PHP Version: 4.3.8
New Comment:
the open command was only:
$fh = fopen($dateiname,'xb');
without '+'
Previous Comments:
------------------------------------------------------------------------
[2004-08-11 13:28:21] tom at bitworks dot de
Description:
------------
Searching for the behavior of all file functions and the right locking
mechanisms I tried to use fopen(filename,xb) with former umask(0222).
That was intended to trigger an error and look into $php_errormsg
But $php_errormsg was disappeared
Reproduce code:
---------------
error_reporting(E_ALL);
ini_set('track_errors','1');
$dateiname = 'opentest123.txt';
$mask = umask(0222);
echo "<br />Mask: $mask<br />";
$fh = fopen($dateiname,'xb+');
$_errors = debug_backtrace();
if (!$fh)
{
echo "<br />Fehler: $php_errormsg<br />";
echo "<br />Fehler: $php_errormsg<br />";
echo '<pre>';
print_r($_errors);
echo '</pre>';
}
else
{
echo "<br />Datei $dateiname wurde angelegt<br />";
$write_ok = fwrite($fh, 'Testtext');
echo "<br />Schreibversuch in $dateiname: $php_errormsg<br />";
}
Expected result:
----------------
Fehler: failed to open stream: Permission denied
Actual result:
--------------
Notice: Undefined variable: php_errormsg in
/home/thomas/public_html/test/artikel_locking/opentest.php on line 27
== echo "<br />Schreibversuch in $dateiname: $php_errormsg<br />";
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29612&edit=1