From:             nanawel at eyeos dot org
Operating system: Windows XP Pro SP2 (32bits)
PHP version:      5.2.6
PHP Bug Type:     Filesystem function related
Bug description:  unlink() doesn't work with path like "file:///C:/my/path..."

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 bug report at http://bugs.php.net/?id=45228&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45228&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45228&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45228&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45228&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45228&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45228&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45228&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45228&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45228&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45228&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45228&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45228&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45228&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45228&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45228&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45228&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45228&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45228&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45228&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45228&r=mysqlcfg

Reply via email to