version 1.4, 2011/07/19 17:02:54 |
version 1.5, 2011/07/19 20:23:44 |
|
|
$searchpath = '/mnt/maket/' . $searchpath; |
$searchpath = '/mnt/maket/' . $searchpath; |
|
|
|
|
|
|
# # follow symlink to achieve real path |
|
# chomp( $_ = `dirname $searchpath | xargs /usr/bin/readlink` ); chomp( $searchpath = $_ . '/' . `basename $searchpath` ); |
|
|
|
# finally, get file size |
# finally, get file size |
$size[$i] = -s $searchpath; |
$size[$i] = -s $searchpath; |
$size[$i] = ($size[$i] > 1048576 ? int($size[$i] / 1024 / 1024) . " MB" : int($size[$i] / 1024) . " KB"); |
$size[$i] = ($size[$i] > 1048576 ? int($size[$i] / 1024 / 1024) . " MB" : int($size[$i] / 1024) . " KB"); |