From: Ryan Leavengood Date: 2005-06-23T02:43:48+09:00 Subject: Re: Newbee: recursively converting LF to CRLF and vice versa Ryan Leavengood said: > > class File > def binary? > (self.read(100) =~ /[\x00-\x06]/) != nil > end > end I realized the above alters the position of the filestream, so I think this is better: class File def binary? old_pos = pos seek(0) match = (read(100) =~ /[\x00-\x06]/) seek(old_pos) match != nil end end Ryan