|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
File Size retrieval
Is there a way to retrieve file size in Perl. I hove found the function for calling wether a file has data or not, but have not seen one for how many bytes, or KB a file is. Can anyone help?
Thanks, RW |
|
#2
|
||||
|
||||
|
Use the stat function.
Code:
$filename = "test.txt"; # your filename comes here my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks) = stat $filename; print "Size of $filename in bytes = $size\n"; Hope this helps ![]() Last edited by Scorpions4ever : February 24th, 2003 at 06:59 PM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > File Size retrieval |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|