Bug #52176 [Com]: unlink() cannot delete symbolic link which points to a directory
| From: | lucas dot ekrause at gmail dot com | Date: | Mon, 21 Oct 2013 19:38:30 +0000 |
| Subject: | Bug #52176 [Com]: unlink() cannot delete symbolic link which points to a directory | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-182368@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=52176&edit=1
ID: 52176
Comment by: lucas dot ekrause at gmail dot com
Reported by: o_shes01 at uni-muenster dot de
Summary: unlink() cannot delete symbolic link which points to
a directory
Status: Not a bug
Type: Bug
Package: Filesystem function related
Operating System: Windows Vista SP2
PHP Version: 5.3.2
Block user comment: N
Private report: N
New Comment:
@felipe@php.net
> Please double-check the documentation [...]
I did, but didn't find anything documenting this issue.
Can you please post a link to the page which is documenting it?
Previous Comments:
------------------------------------------------------------------------
[2013-07-03 15:39:38] kulbakin at ya dot ru
Have similar issue with Windows 7 64 bit php 5.3.26
unlink() for a link created earlier with symlink() call for a directory returns
Warning: unlink([...]): Permission denied in [...] on line [...]
and rmdir() works for it, but on *nix unlink() works for such links.
------------------------------------------------------------------------
[2011-12-15 13:54:10] o_shes01 at uni-muenster dot de
Assuming that $fname is absolute filename of a symbolic link, which points to a directory.
On Linux, unlink($fname) deletes the link itself, and rmdir($fname) does NOT work.
On Windows, unlink($fname) does not work, and rmdir($fname) deletes the link.
This behaviour is not documented in any way.
If this is not a bug, then which is the correct way to delete a symbolic link which points to a
directory?
------------------------------------------------------------------------
[2011-11-15 15:55:07] felipe@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
------------------------------------------------------------------------
[2010-06-24 19:37:57] o_shes01 at uni-muenster dot de
Description:
------------
unlink($fname) fails if the file named by $fname is a symbolic link which points to a directory.
Such a link (not the directory which it points to!) can however be deleted via
"rmdir($fname)", which is also a bug (IMHO).
Note: if the link points to a regular file (not directory), then unlink works as expected (deletes
the link, not the file pointed to).
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=52176&edit=1