note 120778 added to function.readlink
| From: | ayon at hyurl dot com | Date: | Thu, 09 Mar 2017 16:38:27 +0000 |
| Subject: | note 120778 added to function.readlink | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-208889@lists.php.net to get a copy of this message | ||
It is neccesary to be notified that readlink only works for a real link file, if this link file
locates to a directory, you cannot detect and read its contents, the is_link() function will always
return false and readlink() will display a warning is you try to do. Like the following codes:
<?php
//assume that A is a directory located in C:, B is a symlink to A, and A contents a file named C.
echo is_link('B/C'); //false
echo readlink('B/C'); //false and a warning will be displayed
//instead, you should use realpath() function to get the real path of C
echo realpath('B/C'); //C:\A\C
?>
----
Server IP: 72.52.91.14
Probable Submitter: 182.91.179.152
----
Manual Page -- http://php.net/manual/en/function.readlink.php
Edit -- https://master.php.net/note/edit/120778
Del: integrated -- https://master.php.net/note/delete/120778/integrated
Del: useless -- https://master.php.net/note/delete/120778/useless
Del: bad code -- https://master.php.net/note/delete/120778/bad+code
Del: spam -- https://master.php.net/note/delete/120778/spam
Del: non-english -- https://master.php.net/note/delete/120778/non-english
Del: in docs -- https://master.php.net/note/delete/120778/in+docs
Del: other reasons-- https://master.php.net/note/delete/120778
Reject -- https://master.php.net/note/reject/120778
Search -- https://master.php.net/manage/user-notes.php