binary vs. text?

Chris Sheffield cmsheffield at gmail.com
Mon Dec 11 17:21:56 EST 2006


Thanks, Sarah. Very cool idea. Seems to work for me. Can anyone thing  
of any cases that this might fail?

On Dec 11, 2006, at 3:14 PM, Sarah Reichelt wrote:

> On 12/12/06, Chris Sheffield <cmsheffield at gmail.com> 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 :-)
> Sarah
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

------------------------------------------
Chris Sheffield
Read Naturally
The Fluency Company
http://www.readnaturally.com
------------------------------------------





More information about the use-livecode mailing list