os.path.walk problem

Richie Hindle richie at entrian.com
Tue Aug 13 08:41:49 EDT 2002


Terry,

> That's actually very reassuring, except for the
> cases in which it *seems* to work like I expected it to.
> Now I have to explain those.

Some unices will let you read directories as though they were files.
My Unixware box does:

$ uname -a
UNIX_SV connaught 4.2MP 2.1 i386 x86at
$ mkdir directory
$ python -c "print repr( open( 'directory' ).read( 10 ) )"
'\\\000\000\000\000\000\000\000\\\000'
$

My Linux box doesn't let me do this, but it could be dependent on
which filesystem you're using.

-- 
Richie Hindle
richie at entrian.com




More information about the Python-list mailing list