Problem with tsrm_realpath_r on Windows
| From: | Carsten Wiedmann | Date: | Sat, 26 Feb 2011 13:11:08 +0000 |
| Subject: | Problem with tsrm_realpath_r on Windows | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-51537@lists.php.net to get a copy of this message | ||
Hello list,
at the moment I'm having a problem with most filesystem functions (because they are using tsrm_realpath_r internally) and a special situation.
Steps to reproduce:
| md test1
| mklink /j test test1
| icacls test /deny *S-1-1-0:(rd)
at this point I can't create/write to a file in test:
| php -r "file_put_contents('test/test.txt', 'test');"
|
| Warning: file_put_contents(test\test.txt): failed to open stream:
| No such file or directory in Command line code on line 1
even this should be possible.
Also I can't use realpath in this dir (You remember this Pierre? ;-) ):
| cd test
| php -r "var_dump(realpath('.'));"
| bool(false)
even this should also be possible. BTW: getcwd() is working in this dir.
Well, if I change tsrm_realpath_r in tsrm_virtual_cwd.c (line ~863 / php5.3.5) from:
| hLink = CreateFile(path, GENERIC_READ, ...
to
| hLink = CreateFile(path, 0, ...
it's working as expected. But maybe there is another good reason to use GENERIC_READ at this point...
Regards,
Carsten