Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

One-liner: Inspecting a browser cache with File::MMagic

by missingthepoint (Friar)
on Feb 28, 2009 at 02:01 UTC ( #747067=snippet: print w/replies, xml ) Need Help??
Description: Browser caches are interesting places. Firefox, in particular, has many files all with intuitive names like 'FA509DE4d01', and no extensions. Fortunately Unix culture has a method for bringing order to this chaos: 'magic' databases, or files containing bytes found in particular types of files. These allow you to guess a file's type based on its contents. Perl provides 'magic' support in the form of File::MMagic, and the following one-liner uses it to print the guessed types of all files in the current directory. (Update: typo, and removed useless Data::Dumper)
perl -MFile::MMagic -e '$mm=File::MMagic->new; for(glob("*")){$res=$mm
+->checktype_filename($_);print "$_:\t$res\n"}'
Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: snippet [id://747067]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2022-01-21 11:06 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (57 votes). Check out past polls.