Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: understanding file type

by tomfahle (Priest)
on Jun 10, 2009 at 05:57 UTC ( [id://770204]=note: print w/replies, xml ) Need Help??


in reply to understanding file type

Also have a look at File::LibMagic

#!/usr/bin/perl use warnings; use strict; use File::LibMagic ':easy'; my @files = qw( /bin/ls /etc/localtime /etc/timezone /etc/motd ); foreach my $file ( @files ) { print "$file:\n\t", MagicFile( $file ), "\n"; }

which yields

/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for +GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped /etc/localtime: timezone data /etc/timezone: ASCII text /etc/motd: symbolic link to `/var/run/motd'

on my Linux Box.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-24 03:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found