binary vs. text?

Sarah Reichelt sarah.reichelt at
Mon Dec 11 17:14:31 EST 2006

On 12/12/06, Chris Sheffield <cmsheffield at> wrote:
> Does anyone have a sure fire way to determine if a file is binary or
> text?
> I have need to create an import utility that will import data from a
> text file (csv, tab-delimited, etc) into a database, but I'd like to
> check the file before doing anything else just to make sure it is in
> fact text and not binary.

Just a guess here but how about reading the file twice: once as file:
and once as binfile:
If the two are identical, then I assume it's text only.

I have no idea if this will work, but it's worth a try :-)

More information about the Use-livecode mailing list