note 113522 deleted from function.unlink by cmb
| From: | cmb@php.net | Date: | Sun, 29 Dec 2019 11:35:05 +0000 |
| Subject: | note 113522 deleted from function.unlink by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213692@lists.php.net to get a copy of this message | ||
Note Submitter: james at dunmore dot me dot uk
----
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.