Bug #73884 [NEW]: is_dir() returns false for junction / symlinkd

From: Date: Fri, 06 Jan 2017 20:12:48 +0000
Subject: Bug #73884 [NEW]: is_dir() returns false for junction / symlinkd
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206332@lists.php.net to get a copy of this message
From: kulakov74 at yandex dot ru Operating system: Windows 8.1 PHP version: 7.1.0 Package: Filesystem function related Bug Type: Bug Bug description:is_dir() returns false for junction / symlinkd Description: ------------ On my Windows PC, I scanned the whole directory structure in C:\ (both from browsers and in CLI mode) and found out that for all of the junctions / symlinks that had been created by the system is_dir() returns false. According to the manual, "If filename is a symbolic or hard link then the link will be resolved and checked." but this is only the case with the junctions / symlinks I created manually for testing. It might seem the problem is with permissions but I run the script as admin and also I can see the fact that the items in question are junctions by using plain console (cmd.exe) even not as admin, for ex.: c:\Users>dir /a:l ... 22.08.2013 17:45 <SYMLINKD> All Users [C:\ProgramData] 22.08.2013 17:45 <JUNCTION> Default User [C:\Users\Default] ... BTW, In Windows, junctions and symlinks are almost the same. Test script: --------------- $Dir="C:\Users\All Users"; if (is_dir($Dir)) echo("dir"); else echo("not a dir"); Expected result: ---------------- dir Actual result: -------------- not a dir -- Edit bug report at https://bugs.php.net/bug.php?id=73884&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73884&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73884&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73884&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=73884&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=73884&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=73884&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=73884&r=needscript Try newer version: https://bugs.php.net/fix.php?id=73884&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=73884&r=support Expected behavior: https://bugs.php.net/fix.php?id=73884&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=73884&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=73884&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=73884&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73884&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=73884&r=dst IIS Stability: https://bugs.php.net/fix.php?id=73884&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=73884&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=73884&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=73884&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=73884&r=mysqlcfg

« previous php.bugs (#206332) next »