note 72419 added to function.chmod
| From: | hodgman at ali dot com dot au | Date: | Thu, 18 Jan 2007 05:06:16 +0000 |
| Subject: | note 72419 added to function.chmod | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-121873@lists.php.net to get a copy of this message | ||
My PHP script refused to delete read-only files (which is probably a good thing), but I couldnt find
out how to fix this on windows.
The solution is simple, i just replaced
<?php @unlink( $entry ); ?>
with:
<?php
@chmod( $entry, 0777 );
@unlink( $entry );
?>
chmod isnt supposed to work on windows, but 0777 seems to clear the read only flag, and 0444 seems
to set the read only flag.
----
Server IP: 203.16.234.91
Probable Submitter: 203.2.182.254 (proxied: 1.1 AURB-PROXY-03)
----
Manual Page -- http://www.php.net/manual/en/function.chmod.php
Edit -- https://master.php.net/note/edit/72419
Del: integrated -- https://master.php.net/note/delete/72419/integrated
Del: useless -- https://master.php.net/note/delete/72419/useless
Del: bad code -- https://master.php.net/note/delete/72419/bad+code
Del: spam -- https://master.php.net/note/delete/72419/spam
Del: non-english -- https://master.php.net/note/delete/72419/non-english
Del: in docs -- https://master.php.net/note/delete/72419/in+docs
Del: other reasons-- https://master.php.net/note/delete/72419
Reject -- https://master.php.net/note/reject/72419
Search -- https://master.php.net/manage/user-notes.php