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 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

HTH,
Thomas

--
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/



DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to