Rajnikant <[EMAIL PROTECTED]> asked:
> Unix command file gives file type of that file.
> # file a.txt.gz
> a.txt.gz: gzip compressed data, was "a.txt", from Unix
>
> How can I achieve same in perl?
Using a module like
http://search.cpan.org/~pardus/File-MimeInfo-0.15/lib/File/MimeInfo/Magic.pm
Thanks Thomas.
I tried same with File::Type :).
-Original Message-
From: Thomas Bätzler [mailto:[EMAIL PROTECTED]
Sent: Monday, July 07, 2008 4:25 PM
To: Perl Beginners
Cc: Rajnikant
Subject: RE: Getting file type in perl
Rajnikant <[EMAIL PROTECTED]> asked:
> Unix command f
Rajnikant <[EMAIL PROTECTED]> wrote:
> Thanks Thomas.
>
> I tried same with File::Type :).
I considered that module, too, but it's got some problems:
http://cpanratings.perl.org/dist/File-Type
While I don't mind the memory footprint, I would rather have
a module that uses a magic file that can