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

From: Date: Fri, 06 Jan 2017 21:41:55 +0000
Subject: Bug #73884 [Opn]: is_dir() returns false for junction / symlinkd
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206336@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73884&edit=1 ID: 73884 Updated by: ab@php.net Reported by: kulakov74 at yandex dot ru Summary: is_dir() returns false for junction / symlinkd Status: Open Type: Bug Package: Filesystem function related Operating System: Windows 8.1 PHP Version: 7.1.0 Block user comment: N Private report: N New Comment: Thanks for the report. Might be good a permission issue, yep. Would you mind to investigate more on it, maybe checking what difference the extended permissions tell, etc.? Thanks. Previous Comments: ------------------------------------------------------------------------ [2017-01-06 20:12:44] kulakov74 at yandex dot ru 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 this bug report at https://bugs.php.net/bug.php?id=73884&edit=1

« previous php.bugs (#206336) next »