<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>VFS_file::_getNativePath fails on Windows</title> 
  <pubDate>Fri, 10 Apr 2026 03:13:57 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/6904</link> 
  <atom:link rel="self" type="application/rss+xml" title="VFS_file::_getNativePath fails on Windows" href="https://bugs.horde.org/ticket/6904/rss" /> 
  <description>VFS_file::_getNativePath fails on Windows</description> 
 
   
   
  <item> 
   <title>_getNativePath does not work on systems running php on top o</title> 
   <description>_getNativePath does not work on systems running php on top of MS Windows.



The code



if (substr($name, 0, 1) != &#039;/&#039;) {

    $name = &#039;/&#039; . $name;

}



produces &quot;/C:[...]&quot;, which in turn leads to a &quot;Not a directory&quot; 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?)</description> 
   <pubDate>Thu, 12 Jun 2008 14:27:55 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6904#t46318</link> 
  </item> 
   
  <item> 
   <title>&gt; if (substr($name, 0, 1) != &#039;/&#039;) {

&gt;     $name = &#039;/&#039; . $na</title> 
   <description>&gt; if (substr($name, 0, 1) != &#039;/&#039;) {

&gt;     $name = &#039;/&#039; . $name;

&gt; }

&gt;

&gt; produces &quot;/C:[...]&quot;, which in turn leads to a &quot;Not a directory&quot; error

&gt; (e.g. in _listFolder).



I&#039;m not seeing how *this* code block would produce that since it&#039;s the file name and it gets appended to the actual path further down in the code...and it&#039;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? 

</description> 
   <pubDate>Fri, 13 Jun 2008 00:38:20 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6904#t46354</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; if (substr($name, 0, 1) != &#039;/&#039;) {

&gt;&gt;     $name = &#039;/&#039; . $</title> 
   <description>&gt;&gt; if (substr($name, 0, 1) != &#039;/&#039;) {

&gt;&gt;     $name = &#039;/&#039; . $name;

&gt;&gt; }

&gt;&gt;

&gt;&gt; produces &quot;/C:[...]&quot;, which in turn leads to a &quot;Not a directory&quot; error

&gt;&gt; (e.g. in _listFolder).



I&#039;m not an expert on this, but Windows uses &#039;\&#039; instead of &#039;/&#039; as 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?

</description> 
   <pubDate>Fri, 13 Jun 2008 07:13:30 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6904#t46371</link> 
  </item> 
   
  <item> 
   <title>&gt; I&#039;m not an expert on this, but Windows uses &#039;\&#039; instead of</title> 
   <description>&gt; I&#039;m not an expert on this, but Windows uses &#039;\&#039; instead of &#039;/&#039; as 

&gt; directory separator. You can see an example output if you look at the 

&gt; documentation of realpath() in the comments here: 

&gt; http://php.net/manual/de/function.realpath.php.



Well, according to the realpath() documentation, one of the points of 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&#039;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&#039;t exist).  So.... I don&#039;t think this function is a viable option as it will break a lot of our VFS functionality.</description> 
   <pubDate>Sat, 14 Jun 2008 17:18:06 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6904#t46462</link> 
  </item> 
   
  <item> 
   <title>...and thinking this through some more, I&#039;m not even sure I </title> 
   <description>...and thinking this through some more, I&#039;m not even sure I see why this is failing for you at all.  If your on a windows system, shouldn&#039;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?</description> 
   <pubDate>Sat, 14 Jun 2008 17:21:50 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6904#t46463</link> 
  </item> 
   
  <item> 
   <title>&gt; ..but another thought *did* occur to me, that realpath() s</title> 
   <description>&gt; ..but another thought *did* occur to me, that realpath() seems to 

&gt; actually perform a file_exists check on the path and returns FALSE if 

&gt; it&#039;s not found (unless your on a BSD system - in which case it will 

&gt; only return false if the path minus the trailing /xxx doesn&#039;t exist). 



We have Util::realPath() for that purpose, but I agree that this probably is not the solution anyway.</description> 
   <pubDate>Sun, 15 Jun 2008 09:43:02 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6904#t46492</link> 
  </item> 
   
  <item> 
   <title>Can the original requester verify that his VFS configuration</title> 
   <description>Can the original requester verify that his VFS configuration is correct for a windows system and that this is an actual issue? (See comment below)</description> 
   <pubDate>Wed, 18 Jun 2008 17:31:15 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6904#t46646</link> 
  </item> 
   
  <item> 
   <title>ping?</title> 
   <description>ping?</description> 
   <pubDate>Tue, 24 Jun 2008 17:16:43 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6904#t46772</link> 
  </item> 
   
  <item> 
   <title>Probably a configuration error...will reopen if we receive u</title> 
   <description>Probably a configuration error...will reopen if we receive useful feedback</description> 
   <pubDate>Thu, 26 Jun 2008 21:13:06 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6904#t46904</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
