Ruby Rails wrote:
> 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

If your program will always run on a system where that command is
available, you could do:
file_type = `file #{filename}`