From: Lloyd Zusman Date: 2002-08-07T23:04:32+09:00 Subject: Re: Something that corresponds to Perl's -T and -B tests? ts writes: >>>>>> "L" == Lloyd Zusman writes: > > L> I've searched the Ruby documentation, and I can't find descriptions of > L> anything that corresponds to Perl's `-T' and `-B' tests ... these test > L> whether a file contains ASCII text or "binary" data, respectively. > > See [ruby-talk:44936] Thank you very much. Yes, the code in this post this is a version of the text/binary test that currently exists in Perl, and it's pretty much what I would have written ... although I'd probably change the "non-ASCII" test. As coded in the example you referred me to, certain normal ASCII text characters (such as TAB, to name but one) would incorrectly cause a file to be flagged as binary. I also would want this test to be performable on a file that's already open (i.e., an IO object). I'll wait a day or so to see if someone reports any other currently written code, but if not, I'll write and post my own version here. > Guy Decoux Thank you again. -- Lloyd Zusman ljz@asfast.com