note 113522 added to function.unlink
| From: | james at dunmore dot me dot uk | Date: | Thu, 24 Oct 2013 14:52:18 +0000 |
| Subject: | note 113522 added to function.unlink | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-197314@lists.php.net to get a copy of this message | ||
I know it is obvious, but.... if you have nested symlinks (for example, we archive into yyyy-mm for
backups, and symbolic link to make our directory structure look flat - don't ask), unlink will
only delete the top level symlink (as expected).
If you want to delete the actual file, you'll need to use readlink. If you want to delete all
of the files and the symlinks, you'll need to recurse up and down to achieve that.
----
Server IP: 69.147.83.199
Probable Submitter: 84.233.192.242
----
Manual Page -- http://php.net/manual/en/function.unlink.php
Edit -- https://master.php.net/note/edit/113522
Del: integrated -- https://master.php.net/note/delete/113522/integrated
Del: useless -- https://master.php.net/note/delete/113522/useless
Del: bad code -- https://master.php.net/note/delete/113522/bad+code
Del: spam -- https://master.php.net/note/delete/113522/spam
Del: non-english -- https://master.php.net/note/delete/113522/non-english
Del: in docs -- https://master.php.net/note/delete/113522/in+docs
Del: other reasons-- https://master.php.net/note/delete/113522
Reject -- https://master.php.net/note/reject/113522
Search -- https://master.php.net/manage/user-notes.php