From: daniel dot stelter-gliese at innogames dot de Operating system: Windows Server 2012 PHP version: 5.4.7 Package: Win32API related Bug Type: Bug Bug description:PHP fails to open Windows deduplicated files
Description: ------------ Opening a file that was deduplicated by Windows Server 2012 deduplication fails with "No such file or directory". The behavior can be reproduced locally and through SMB shares (on Win7 and Win8 clients). I've tried 5.3.15 and 5.4.7 - judging from the code latest snapshots are affected, too. I could trace this to a problem with reparse points: deduplication adds the new reparse tag IO_REPARSE_TAG_DEDUP. There seems to be no documentation on this tag, so I could only interpret it as a flag to be ignored. The attached patch simply treats a IO_REPARSE_TAG_DEDUP file as a substitute on the same path, which worked well. Test script: --------------- $path = 'S:\\test.exe'; var_dump(filesize($path)); var_dump(realpath($path)); var_dump(strlen(file_get_contents($path))); var_dump(fopen($path, 'rb')); Expected result: ---------------- int(5448704) string(50) "S:\test.exe" int(5448704) resource(6) of type (stream) Actual result: -------------- int(5448704) bool(false) Warning: file_get_contents(S:\test.exe): failed to open stream: No such file or directory in C:\php-sdk\php54dev\vc9\x64\ php-5.4.7-src\x64\Release\test.php on line 6 int(0) Warning: fopen(S:\test.exe): failed to op en stream: No such file or directory in C:\php-sdk\php54dev\vc9\x64\php-5.4.7-sr c\x64\Release\test.php on line 7 bool(false) -- Edit bug report at https://bugs.php.net/bug.php?id=63241&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63241&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63241&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63241&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=63241&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=63241&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=63241&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=63241&r=needscript Try newer version: https://bugs.php.net/fix.php?id=63241&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=63241&r=support Expected behavior: https://bugs.php.net/fix.php?id=63241&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=63241&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=63241&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=63241&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63241&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=63241&r=dst IIS Stability: https://bugs.php.net/fix.php?id=63241&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=63241&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=63241&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=63241&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=63241&r=mysqlcfg