ID:               45228
 User updated by:  nanawel at eyeos dot org
 Reported By:      nanawel at eyeos dot org
 Status:           Open
 Bug Type:         Filesystem function related
-Operating System: *
+Operating System: Windows
 PHP Version:      5.2.6
 New Comment:

Just changed the OS concerned by the issue.


Previous Comments:
------------------------------------------------------------------------

[2008-07-14 20:08:57] nanawel at eyeos dot org

Another great one:
rmdir() DOES NOT WORK with the file:// scheme, AT ALL.
Tested on Windows and Ubuntu 8.04 (both on PHP 5.2.6).

------------------------------------------------------------------------

[2008-06-10 16:46:19] nanawel at eyeos dot org

A new set of problems:

- mkdir() only works with file://C:/my/path
  and fails on            file:///C:/my/path
  or                      file://localhost/C:/my/path

- rmdir() DOES NOT WORK with file://C:/my/path
  or                         file:///C:/my/path
  or                         file://localhost/C:/my/path

------------------------------------------------------------------------

[2008-06-10 16:03:21] nanawel at eyeos dot org

Additionnally, unlink() doesn't work either on URL like:
file://localhost/C:/my/path
and this is particularly _not_ normal.

------------------------------------------------------------------------

[2008-06-10 15:56:21] nanawel at eyeos dot org

Description:
------------
The unlink() function does not work with full Windows URL, whereas
fopen() for example works perfectly.

If you provide a path like this: file:///C:/my/path
(triple slashes) it won't work and you will get this warning:
Warning: unlink(/C:/my/path) [function.unlink]: Invalid argument in...

But if you provide this path: file://C:/my/path
(so just a slash less) unlink will work.

Reproduce code:
---------------
//For the example, we consider that PHP has full permissions on
config.sys, which is not the case normally)

$path1 = 'file:///C:/config.sys';
$path2 = 'file://C:/config.sys';

$fp = fopen($path1, 'r');  //OK
@fclose($fp);
unlink($path1);            //ERROR

$fp = fopen($path2, 'r');  //OK
@fclose($fp);
unlink($path2);            //OK

Expected result:
----------------
unlink() should work with the same standards URL as fopen().
In my example, $path1 should be correct for both functions.

Actual result:
--------------
Windows absolute URL like file:///C:/... work with fopen(), rename()
but _not_ with unlink() (+ Warning raised)

Windows non-standard URL like file://C:/... work with fopen(), rename()
and unlink()


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=45228&edit=1

Reply via email to