in reply to File identifier

I'm just curious, why don't you use file(1) ?

# file <filename>

Replies are listed 'Best First'.
RE: RE: File identifier
by Corion (Patriarch) on Jun 07, 2000 at 02:35 UTC

    I do most of my stuff under NT, and there is no file(1) available ;) - also, why delve into bash programming when I can do it in Perl ...

      Useful Script.  
      How did you know to use:
      "\xFF\xF0-\xFF"
      for identifying MP3 files?
      
      I have tried unpack and sprintf, but I'm guessing I'm using those funcions wrong.
      

        The sequence of 12 "one" bits, starting at a byte boundary, is what the MPEG audio layer 3 spec says :-) See http://www.euronet.nl/~soloh/mpegEnc/textfiles/mpeg-AFS.txt for example, I didn't come up with a better thing in the minute I searched Google ;-)

        perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web