Summary | VFS_file::_getNativePath fails on Windows |
Queue | Horde Framework Packages |
Queue Version | HEAD |
Type | Bug |
State | No Feedback |
Priority | 1. Low |
Owners | Horde Developers (at) |
Requester | christian.ost (at) gmail (dot) com |
Created | 06/12/2008 (6235 days ago) |
Due | |
Updated | 06/26/2008 (6221 days ago) |
Assigned | 06/13/2008 (6234 days ago) |
Resolved | 06/26/2008 (6221 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
State ⇒ No Feedback
Priority ⇒ 1. Low
correct for a windows system and that this is an actual issue? (See
comment below)
actually perform a file_exists check on the path and returns FALSE if
it's not found (unless your on a BSD system - in which case it will
only return false if the path minus the trailing /xxx doesn't exist).
probably is not the solution anyway.
this is failing for you at all. If your on a windows system,
shouldn't the path you configured for the vfsroot have the necessary
drive specifier? Can you provide the vfsroot your using as well as
the path and filename you are providing to the_getNativePath() function?
directory separator. You can see an example output if you look at the
documentation of realpath() in the comments here:
http://php.net/manual/de/function.realpath.php.
realpath() is to convert unix-style to windows style when appropriate,
so the result of realpath should be a windows friendly path.
..but another thought *did* occur to me, that realpath() seems to
actually perform a file_exists check on the path and returns FALSE if
it's not found (unless your on a BSD system - in which case it will
only return false if the path minus the trailing /xxx doesn't exist).
So.... I don't think this function is a viable option as it will break
a lot of our VFS functionality.
$name = '/' . $name;
}
produces "/C:[...]", which in turn leads to a "Not a directory" error
(e.g. in _listFolder).
directory separator. You can see an example output if you look at the
documentation of realpath() in the comments here:
http://php.net/manual/de/function.realpath.php.
Maybe PHP accepts path using C:\ and C:/ notation, but our path
building function is still wrong and will compute wrong paths, no?
New Attachment: vfs.diff
$name = '/' . $name;
}
produces "/C:[...]", which in turn leads to a "Not a directory" error
(e.g. in _listFolder).
file name and it gets appended to the actual path further down in the
code...and it's *that* code that probably is causing the results your
seeing. Does wrapping the return values in realpath() as in the
attached patch solve the issue for you?
State ⇒ Assigned
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ VFS_file::_getNativePath fails on Windows
Type ⇒ Bug
The code
if (substr($name, 0, 1) != '/') {
$name = '/' . $name;
}
produces "/C:[...]", which in turn leads to a "Not a directory" error
(e.g. in _listFolder).
As the horde VFS lib is also included in the PEAR repository, this
issue concerns a broad range
of users.
A possible workaround could use the PHP_OS variable (or
PEAR::OS_Guess) for OS-dependent handling, or the realpath function of
php (why a custom UNIX-only function here?)