From: Daniel Berger Date: 2007-06-20T03:21:05+09:00 Subject: Re: Check for text file On Jun 19, 11:33 am, Alin Popa wrote: > Ryan Davis wrote: > > On Jun 18, 2007, at 23:59 , Alin Popa wrote: > > >> After some research I still cannot find a way how to see if a file is > >> plain text or binary. In fact I want to check if a file is plain > >> text no > >> matter what characters are in it. > > >http://blog.zenspider.com/archives/2006/08/i_miss_perls_b.html > > Nice, thanks. Which I shamelessly plagiarized and stuck in the ptools library. gem install ptools File.binary?('some_file') Regards, Dan