All you need to get the file size is -s.

I.e. $file_size = -s $file

Save the following script as size.pl, and run like this:

perl size.pl size.pl

use strict;
use warnings;
my $file = $ARGV[0];
my $file_size = -s $file;
print "$file is $file_size bytes\n";


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tony Cheung
Sent: 03 November 2004 06:54
To: perl-win32-users
Subject: How to obtain filesize?


I have a perl program about update file from pc to mysql,but I want to limit 
filesize,how to obtain filesize and file type?




Do You Yahoo!?
150万曲MP3疯狂搜,带您闯入音乐殿堂
美女明星应有尽有,搜遍美图、艳图和酷图
1G就是1000兆,雅虎电邮自助扩容!

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to