Does File::MMagic checks the file headers?
I read in the POD that checks the file from the filename :) not deep
checking :)
----- Original Message -----
From: "MAC OS [EMAIL PROTECTED]" <[EMAIL PROTECTED]>
To: "John" <[EMAIL PROTECTED]>
Cc: "Perl Beginners" <[EMAIL PROTECTED]>
Sent: Saturday, February 21, 2004 9:09 PM
Subject: Re: Checking about gif
>
> On 21 Feb 2004, at 19:03, John wrote:
>
> > I want to test if a file is a gif image or not.
> >
> > Is it practicable using a module?
>
> perldoc File::MMagic
>
> #!/usr/bin/perl -w
>
> use strict;
>
> die "Usage: $0 directory\n" unless @ARGV > 0;
>
> use File::Find;
> use File::MMagic;
>
> my $mm = File::MMagic->new;
> find sub {
> return if -d $_ or -l $_;
> my $type = $mm->checktype_filename($_);
> return unless $type =~ /gif/i;
> print "$File::Find::name: $type\n";
> }, @ARGV;
>
> I just happen to be reading an excellent series of articles by Randal
> ... You should read them as well...
>
> http://www.google.com/search?
> site=swr&q=site%3Astonehenge.com&as_q=File%3A%3AFind&btnG=Search+stonehe
> nge.com+with+Google
>
> Jerry
>
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>