[Python-Dev] Mac OSX issues
Tim Peters
tim_one@email.msn.com
Thu, 28 Nov 2002 11:18:59 -0500
[Jack Jansen]
> Do you mean that on other systems it does *not* create these gigantic
> files??!? I've always wondered what the use was... Hmm, if this test
> test support for files with holes,
No, it's testing support for large files period. If the OS supports large
files, and you've got enough disk space, it should pass regardless of
whether the filesystem sticks holes in the middle.
> how come that Windows then doesn't have the same problem as the Mac, it
> also doesn't support holes in files, or does it?
Holes are irrelevant to correct functioning. On Win2K the test passes and
does indeed take a very long time. On Win9X the test passes but takes very
little time. The difference seems to be that Win2K actually fills a file
with gigabytes of NUL characters, but on Win9X you effectively get a window
onto whatever happened to be sitting on disk in the blocks allocated for the
file. But in neither case are there holes.
Here on Win98SE:
>>> f = file('temp.dat', 'wb')
>>> f.seek(1000000)
>>> f.write('abc')
>>> f.close()
>>> f = file('temp.dat', 'rb')
>>> guts = f.read()
>>> len(guts)
1000003
>>> guts[50000:50050]
'|\x88\x08\x004\x0e6\x0e7\x0e8\x0e:\x0e;\x0eQ\x0e=\x0e>\x0e?\x0e@\x0eA\x0eB
\x0eD\x0eE\x0eF\x0eH\x0eI\x0eJ\x0eQ\x0eL\x0eM\x0eQ\x0e'
>>>
You could very well find personal info in there! Win2K prevents that.