FAQ
I think I've found what I need.

The module is called magic.py.

It show if the file is data or text.

It can be downloaded from http://www.demonseed.net/~jp/code/


"Sami Viitanen" <none at none.net> wrote in message
news:gwH_a.1649$k4.34358 at news2.nokia.com...
Thanks for the answers.

To be more specific I'm making a script that should
identify binary files as binary and text files as text.

The script is for automating CVS commands and
with CVS you have to add the -kb flag to
add (or import) binary files. (because it can't itself
determine what type the file is). If binary file is not
added with -kb the results are awful.

Script example usage:
-import.py <directory_name>

Script makes list of all files under that directory
and then determines each files filetype. After that
all files are added with Add command and binary
files get that additional -kb automatically.


"Sami Viitanen" <none at none.net> wrote in message
news:AFm_a.9725$g4.189983 at news1.nokia.com...
Hello,

How can I check if a file is binary or text?

There was some easy way but I forgot it..


Thanks in adv.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 21 of 25 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedAug 13, '03 at 8:29a
activeAug 16, '03 at 2:27a
posts25
users12
websitepython.org

People

Translate

site design / logo © 2022 Grokbase