stat($filename) , Cant get to work , Frustrated
stat($filename) , Cant get to work , Frustrated
(OP)
The "random.txt" file resides in the same folder as the function call.
-------------------RESULT------------------------------
$device is :
$ino is :
$mode is :
$nlink is :
$uid is :
-------------------SCRIPT-----------------------------
open (INFILE, "random.txt") or die ("error");
($device,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks) = stat(random.txt);
close INFILE;
print('$device is :'.$device."\n");
print('$ino is :'.$ino ."\n");
print('$mode is :'.$mode."\n");
print('$nlink is :'.$nlink."\n");
print('$uid is :'.$uid."\n");
-------------------RESULT------------------------------
$device is :
$ino is :
$mode is :
$nlink is :
$uid is :
-------------------SCRIPT-----------------------------
open (INFILE, "random.txt") or die ("error");
($device,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks) = stat(random.txt);
close INFILE;
print('$device is :'.$device."\n");
print('$ino is :'.$ino ."\n");
print('$mode is :'.$mode."\n");
print('$nlink is :'.$nlink."\n");
print('$uid is :'.$uid."\n");
RE: stat($filename) , Cant get to work , Frustrated
($device,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat("./random.txt");
Also, I think you are confused with the open...stat....close series of operations. You do not need to do an open to do the stat. And, opening the file will cause changes in the info you get back from stat.
HTH
keep the rudder amid ship and beware the odd typo