On Sun, 18 Jan 2004 15:55:42 -0800
Gary Kline <[EMAIL PROTECTED]> wrote:

>       
>       Is there an easy way of determining "file - determine file type"
>       in perl? at least as certain as magic(5) can ascertain?
> 
>       E.g:
> 
>       if (($ftype = file ($ARV[i])) eq "script){
>               ## do abc;
>       }
>       else if ($ftype eq "Mail"){
>               ## do def;
>       }
>       else if ($type eq "C program"){
>               ## do xyz;
>       }
>       .
>       .
>       .
> 
>       I've been poking around perl tutorial sites; so far, nada.
>       Thought I'd ask the wizards.
> 
>       thanks for any clues,
> 
>       gary

How about /usr/ports/devel/p5-File-MMagic ?

"This module is to guess file type from its contents like file(1)
command."

-Chris
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to