On Tue, Mar 31, 2009 at 12:23 PM, ritu <ritu_bhandar...@yahoo.com> wrote:

> Hi,
>
> I'm wondering if Python has a utility to detect binary content in
> files? Or if anyone has any ideas on how that can be accomplished? I
> haven't been able to find any useful information to accomplish this
> (my other option is to fire off a perl script from within m python
> script that will tell me whether the file is binary), so any pointers
> will be appreciated.
>


All files are binary. The question is whether every byte in the file
represents a (whole or part of a) character or whether some of the data
represents a different data type. You could theoretically have a "binary"
file that appears in a text editor to be perfect English. How does your perl
script tell the difference?



http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to