From: Phrogz Date: 2006-10-11T04:10:18+09:00 Subject: Re: equivalent of unix "file " in ruby? Ruby Rails wrote: > I'm trying to find out what is the equivalent of file 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}`