binary vs. text?

Chris Sheffield cmsheffield at gmail.com
Mon Dec 11 17:29:47 EST 2006


Thanks, Eric. I shouldn't have a problem with Sarah's method since  
these files will not be downloaded from the internet at all.

On Dec 11, 2006, at 3:23 PM, Eric Chatonet wrote:

> Hi Chris,
>
> Sarah's answer sounds good (I mean fully reliable) but may appear  
> unusable with heavy files you download from the internet.
> As for us we use another method based on statistics by checking  
> charToNum's chars.
> On Windows, it appears that checking 60 chars and finding more than  
> 3 chars the charToNum of which is less than 9 or greater than 175  
> gives an "almost" fully reliable result ;-)
>
> Le 11 déc. 06 à 23:09, Chris Sheffield a écrit :
>
>> 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.
>>
>> Any thoughts?
>
>
> Best Regards from Paris,
> Eric Chatonet
> ---------------------------------------------------------------------- 
> ------------------------
> http://www.sosmartsoftware.com/    eric.chatonet at sosmartsoftware.com/
>
>
> _______________________________________________
> 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