Message32648
Worked as expected for me on Mac OS X 10.4.10 running from
the trunk (you didn't mention what version you were using).
In ~/tmp/deep I created a maximally nested directory tree from the shell like so:
cd /Users/skip/tmp/deep
for i in `range 1000` ; do
x=`printf %04d $i`
echo $x
mkdir $x
cd $x
done
where the range command is analogous to Python's range
builtin:
% range 20
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
The for loop barfed after making directory 0205.
In Python I then executed these statements:
import os.path
base = "/Users/skip/tmp/deep"
for x in range(210):
subdirs = os.listdir(base)
base = os.path.join(base, subdirs[0])
print base
This went until it got to dir 0200 where it raised an
OSError:
[Errno 63] File name too long: '/Users/skip/tmp/deep/0000/0001/.../0199/0200'
which stands to reason since base was 1025 characters long
at that point. MAXPATHLEN is defined to be 1024 on my
system, so the OSError is to be expected.
Skip
|
|
Date |
User |
Action |
Args |
2007-08-23 14:59:14 | admin | link | issue1776160 messages |
2007-08-23 14:59:14 | admin | create | |
|