Bug #63241 [Asn]: PHP fails to open Windows deduplicated files
| From: | pajoye@php.net | Date: | Wed, 10 Oct 2012 08:27:16 +0000 |
| Subject: | Bug #63241 [Asn]: PHP fails to open Windows deduplicated files | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-173979@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63241&edit=1
ID: 63241
Updated by: pajoye@php.net
Reported by: daniel dot stelter-gliese at innogames dot de
Summary: PHP fails to open Windows deduplicated files
Status: Assigned
Type: Bug
Package: Win32API related
Operating System: Windows Server 2012
PHP Version: 5.4.7
Assigned To: mattficken
Block user comment: N
Private report: N
New Comment:
Thanks for the very good report :) We can reproduce it and added it to our tests
suite.
I'd to see how to deal with deduplicated files, if we have to cache them the same
way we do for links or mounted volumes (necessary for require_once and the likes).
Previous Comments:
------------------------------------------------------------------------
[2012-10-09 08:03:54] pajoye@php.net
Matt, can you try to reproduce it please?
------------------------------------------------------------------------
[2012-10-08 16:17:44] daniel dot stelter-gliese at innogames dot de
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 this bug report at https://bugs.php.net/bug.php?id=63241&edit=1