Bug #70139 [NEW]: is_link or DirectoryIterator->isLink don't work

From: Date: Sun, 26 Jul 2015 10:12:26 +0000
Subject: Bug #70139 [NEW]: is_link or DirectoryIterator->isLink don't work
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194719@lists.php.net to get a copy of this message
From: tomkrawc at gmail dot com Operating system: Windows 7 64bit PHP version: 5.5.27 Package: Win32API related Bug Type: Bug Bug description:is_link or DirectoryIterator->isLink don't work Description: ------------ Neighter is_link nor DirectoryIterator->isLink are not distinguish symlinks created with os command mklink. Os is showing them: 2015-07-26 09:23 <DIR> . 2015-07-26 09:23 <DIR> .. 2015-05-23 20:55 <DIR> _backup 2015-05-23 20:55 <DIR> _logi 2015-07-26 09:23 <DIR> fileadmin 2015-07-26 08:39 <SYMLINKD> typo3 [typo3_src\typo3] 2015-07-26 08:39 <SYMLINKD> typo3_src [..\typo3_src-6.2.14] 2015-07-26 09:23 <DIR> typo3conf 2015-07-26 09:23 <DIR> typo3temp 2015-07-26 09:23 <DIR> uploads 2015-05-24 10:12 5 199 .htaccess 2015-04-14 20:03 113 index.html 2015-07-26 08:39 <SYMLINK> index.php [typo3_src\index.php] 2015-05-23 18:40 19 pi.php My env is Win 7 x64, WAMP (Apache 2.4.9, PHP 5.5.12 Thread Safe). Test script: --------------- if ($handle = opendir($dir)) { echo "Directory handle: $handle\n"; echo "Entries:\n"; while (false !== ($entry = readdir($handle))) { if (is_link($dir . $entry)) { $strTarget = readlink($entry); echo '>>LINK<<: ' . $entry . ' => ' . $strTarget . "\n"; } elseif (is_file($dir . $entry)) { echo 'File: ' . $entry . "\n"; } elseif (is_dir($dir . $entry)) { echo 'Dir: ' . $entry . "\n"; } else { echo "? - $entry\n"; } } closedir($handle); } Expected result: ---------------- both of those methods should return true Actual result: -------------- both of those methods should return false -- Edit bug report at https://bugs.php.net/bug.php?id=70139&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70139&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70139&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70139&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=70139&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=70139&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=70139&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=70139&r=needscript Try newer version: https://bugs.php.net/fix.php?id=70139&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=70139&r=support Expected behavior: https://bugs.php.net/fix.php?id=70139&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=70139&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=70139&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=70139&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70139&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=70139&r=dst IIS Stability: https://bugs.php.net/fix.php?id=70139&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=70139&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=70139&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=70139&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=70139&r=mysqlcfg

« previous php.bugs (#194719) next »