|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-07-19 14:43 UTC] 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 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 05:00:01 2025 UTC |
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..