note 72038 added to function.is-link
| From: | neverpanic-gmail | Date: | Sat, 30 Dec 2006 10:50:18 +0000 |
| Subject: | note 72038 added to function.is-link | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-121076@lists.php.net to get a copy of this message | ||
For me (Debian Sarge VPS) is_link returns true even for directories if you don't add a trailing
slash to the filename.
<?php
if ($dir{strlen($dir)-1} == '/') $dir = substr($dir, 0, -1);
is_link($dir);
?>
This works for me. It can't detect a symlink somewhere in a complete path, though (i.e.
is_link(/www/somedir/file.php) will return false, just as is_link(/www/) would)
----
Server IP: 212.124.37.9
Probable Submitter: 217.229.222.140
----
Manual Page -- http://www.php.net/manual/en/function.is-link.php
Edit -- https://master.php.net/note/edit/72038
Del: integrated -- https://master.php.net/note/delete/72038/integrated
Del: useless -- https://master.php.net/note/delete/72038/useless
Del: bad code -- https://master.php.net/note/delete/72038/bad+code
Del: spam -- https://master.php.net/note/delete/72038/spam
Del: non-english -- https://master.php.net/note/delete/72038/non-english
Del: in docs -- https://master.php.net/note/delete/72038/in+docs
Del: other reasons-- https://master.php.net/note/delete/72038
Reject -- https://master.php.net/note/reject/72038
Search -- https://master.php.net/manage/user-notes.php