"show symlinks in ls -l"

This commit is contained in:
Ralf Becker 2009-03-24 16:27:29 +00:00
parent 5501dd0fc3
commit 3927555c22

View File

@ -655,8 +655,11 @@ function do_stat($url,$long=false,$numeric=false,$full_path=false)
$size = hsize($stat['size']); $size = hsize($stat['size']);
$mtime = date('Y-m-d H:i:s',$stat['mtime']); $mtime = date('Y-m-d H:i:s',$stat['mtime']);
$nlink = $stat['nlink']; $nlink = $stat['nlink'];
if (($stat['mode'] & 0xA000) == 0xA000)
echo "$perms $nlink\t$uid\t$gid\t$size\t$mtime\t$bname\n"; {
$symlink = " -> ".(class_exists('egw_vfs') ? egw_vfs::readlink($url) : readlink($url));
}
echo "$perms $nlink\t$uid\t$gid\t$size\t$mtime\t$bname$symlink\n";
} }
else else
{ {
@ -788,7 +791,15 @@ function do_find($bases,$options)
*/ */
function int2mode( $mode ) function int2mode( $mode )
{ {
if($mode & 0x1000) // FIFO pipe if(($mode & 0xA000) == 0xA000) // Symbolic Link
{
$sP = 'l';
}
elseif(($mode & 0xC000) == 0xC000) // Socket
{
$sP = 's';
}
elseif($mode & 0x1000) // FIFO pipe
{ {
$sP = 'p'; $sP = 'p';
} }
@ -808,14 +819,6 @@ function int2mode( $mode )
{ {
$sP = '-'; $sP = '-';
} }
elseif($mode & 0xA000) // Symbolic Link
{
$sP = 'l';
}
elseif($mode & 0xC000) // Socket
{
$sP = 's';
}
else // UNKNOWN else // UNKNOWN
{ {
$sP = 'u'; $sP = 'u';