ID: 42049
Updated by: [EMAIL PROTECTED]
Reported By: mahesh dot vemula at in dot ibm dot com
-Status: Open
+Status: Feedback
Bug Type: Filesystem function related
Operating System: Windows XP
PHP Version: 5CVS-2007-07-19 (snap)
New Comment:
I think it's how chmod on windows works. Try this:
<?php
$file_name = tempnam(".", "temp");
chmod($file_name, 0600);
clearstatcache();
printf("%o", fileperms($file_name) );
?>
I bet you still get 0666..
Previous Comments:
------------------------------------------------------------------------
[2007-07-19 14:43:46] mahesh dot vemula at in dot ibm dot com
Description:
------------
The unique file created by tempnam() has the default permissions of
0666 on Windows. But according to documentation
http://in.php.net/manual/en/function.tempnam.php, the default
permissions are 0600. On Linux tempnam() creates a file with permissions
of 0600 as expected i.e according to documentation.
If this is the expected behavior on Windows, please fix the
documentation.
Reproduce code:
---------------
<?php
$file_name = tempnam(".", "temp");
printf("%o", fileperms($file_name) );
unlink($file_name);
?>
Expected result:
----------------
100600
Actual result:
--------------
100666
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42049&edit=1