Edit report at https://bugs.php.net/bug.php?id=65697&edit=1

 ID:                 65697
 Updated by:         paj...@php.net
 Reported by:        giunta dot gaetano at gmail dot com
 Summary:            is_link not working with windows junctions
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            *Directory/Filesystem functions
 Operating System:   win7 64bit
 PHP Version:        5.4.19
 Block user comment: N
 Private report:     N

 New Comment:

Junctions are not symlinks, the result is correct. Also the 
junctions pointing to a directory may work. I remember 
some windows version specific changes here, where it 
ended as symlink or junction (recent always do it as 
symlonk afair)


Previous Comments:
------------------------------------------------------------------------
[2013-09-18 12:51:32] giunta dot gaetano at gmail dot com

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 this bug report at https://bugs.php.net/bug.php?id=65697&edit=1

Reply via email to