-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
realpath returns wrong results for files > 2GB #1
Comments
I'll check it on Linux Mint. Windows Server 2008/2003 not affected. |
This PHP bug seems related (to #3 as well): https://bugs.php.net/bug.php?id=27792 |
Checking the return value of realpath() would be a good start. |
Changed mechanism of setting path. Now throws exception. (branch: master) |
Idea: if file:// is resolved to current directory, does it resolve relative paths? |
Closed due to innactivity. Reopen anytime if it is still relevant. |
Env.: PHP 5.3.5, 64bit machine with 32bit Suse linux 11.4
Tried with 670MB, 2.6GB, 4.6GB and 6.8GB files and symlinks to them.
For regular files the behavior is consistently wrong: if file size is over PHP_INT_MAX, realpath return FALSE. Results for symlinks are rather unsure: if you call
clearstatcache
beforerealpath
, you'll get the same as with regular files. Withoutclearstatcache
however, realpath for first time return FALSE, then after refreshing the page it starts returning resolved symlink (= absolute path to file). If you don't refresh the page for approx 30sec, you're back on the beginning - first FALSE, then correct path.This affects mainly the
sizeCurl
method - ifrealpath
(that is,this->$path
after callingabsolutizePath
) returns FALSE, then the address resolves tofile://
and the size of current directory is returned.The same applied for regular files on FAT32 partition (no symlinks of course and only the two smallest).
Found some realpath replacement here: http://stackoverflow.com/questions/4049856/replace-phps-realpath , but didn't try it yet. Personally I'm using absolute paths whenever possible.
The text was updated successfully, but these errors were encountered: