On Thu, 15 Jan 2004, Andre Chaves Mascarenhas wrote:
> Hello i wanna know what Perl module can I use and what commands to do the folowing:
> 1-Check to see if the file is a valid jpg file
You didn't say what OS. If you're running Linux (or almost any UNIX based
system), then I'd do something like:
if (`file $file` =~ /JPEG/) {
print "$file appears to be a JPEG file.\n";
} else {
print "$file does not appear to be a JPEG file.\n";
}
> 2-Check the file size
print "$file is ",-s $file," bytes.\n";
>
> Thanks in advance
>
--
--
Maranatha!
John McKown
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>