> How can I check if a file is binary or text? >>> import os >>> f = os.popen('file -bi test.py', 'r') >>> f.read().startswith('text') 1 (btw, f.read() returns 'text/x-java; charset=us-ascii\n') -- bromden[at]gazeta.pl