From: giunta dot gaetano at gmail dot com
Operating system: win7 64bit
PHP version: 5.4.19
Package: *Directory/Filesystem functions
Bug Type: Bug
Bug description:is_link not working with windows junctions
Description:
------------
is_link seems to return false for junction points which show up as
<JUNCTION> when using the DIR command.
It seems to work for junctions which show up as <SYMLINKD> when using the
DIR command.
tested on php 5.3.27 and 5.4.14 (32 bit of course)
Test script:
---------------
<?php
$paths = array(
"linksource",
"linktarget",
"linktarget2"
);
foreach ( $paths as $path )
{
echo "----\n $path\n";
var_dump( is_link( $path ) );
var_dump( is_dir( $path ) );
var_dump( array_diff( stat($path), lstat($path) ) );
}
Expected result:
----------------
results of DIR command:
07/09/2013 15:59 <DIR> linksource
07/09/2013 19:11 <JUNCTION> linktarget [D:\htdocs\linksource]
18/09/2013 14:30 <SYMLINKD> linktarget2 [linksource]
Actual result:
--------------
D:\htdocs>php linktest.php
----
linksource
bool(false)
bool(true)
array(0) {
}
----
linktarget
bool(false)
bool(true)
array(8) {
[2]=>
int(16895)
[8]=>
int(1378562389)
[9]=>
int(1378562389)
[10]=>
int(1378562389)
["mode"]=>
int(16895)
["atime"]=>
int(1378562389)
["mtime"]=>
int(1378562389)
["ctime"]=>
int(1378562389)
}
----
linktarget2
bool(true)
bool(true)
array(8) {
[2]=>
int(16895)
[8]=>
int(1378562389)
[9]=>
int(1378562389)
[10]=>
int(1378562389)
["mode"]=>
int(16895)
["atime"]=>
int(1378562389)
["mtime"]=>
int(1378562389)
["ctime"]=>
int(1378562389)
}
--
Edit bug report at https://bugs.php.net/bug.php?id=65697&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=65697&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=65697&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=65697&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=65697&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=65697&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65697&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=65697&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=65697&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=65697&r=support
Expected behavior: https://bugs.php.net/fix.php?id=65697&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=65697&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=65697&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=65697&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65697&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=65697&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=65697&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=65697&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65697&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65697&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=65697&r=mysqlcfg