in reply to RE: File identifier
in thread File identifier

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

Replies are listed 'Best First'.
Re: RE: RE: File identifier
by gohaku (Sexton) on Sep 07, 2003 at 19:55 UTC
    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