Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: Getting File Type using Regular Expressions

by rob_au (Abbot)
on Apr 21, 2004 at 14:10 UTC ( #347012=note: print w/ replies, xml ) Need Help??


in reply to Re: Getting File Type using Regular Expressions
in thread Getting File Type using Regular Expressions

On Unix, a tool called 'file' has a large and growing database of file type heuristics. File::Type is a Perl module equivalent. These read just enough of a file to make a solid guess as to the type, and report it.
I feel that the File::MMagic module provides a more mature alternative to the File::Type module to provide file-like functions. This module has the added advantage in that it can read in the same magic files as those employed for file to extend its recognition profile.

 

perl -le "print unpack'N', pack'B32', '00000000000000000000001011010010'"


Comment on Re: Re: Getting File Type using Regular Expressions
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://347012]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2014-07-12 13:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (240 votes), past polls