On Wed, 11 Oct 2006, Ruby Rails wrote:

> Hi all,
> I'm trying to find out what is the equivalent of file <filename> from
> unix in ruby. Basically this command gives the file type - ASCII, BINARY
> etc.

There is currently nothing written in ruby that uses a library of 
signatures to attempt to figure out the file type of a file.  The best you 
can do right now is a library that looks at the file suffix and determines 
what file type matches it.

Download Austin Zeigler's mime-types lib (when Rubyforge is playing nicely 
again).

  mime_type = MIME::Types.type_for(filename)



Kirk Haines