[Python-checkins] CVS: python/dist/src/Lib/test test_largefile.py,1.7,1.8

Thomas Wouters thomas@xs4all.net
Thu, 6 Sep 2001 13:26:51 +0200


On Thu, Sep 06, 2001 at 05:01:02AM -0400, Guido van Rossum wrote:

> > 2. That files so extended are magically filled with null bytes.

> > I find no support for either in the C std, and #2 in particular turns out
> > not to be true on Win32 (you apparently see whatever trash happened to be
> > on disk).  Left #1 intact, but changed the test to check only bytes it
> > explicitly wrote.  Also fiddled the "expected" vs "got" failure reports
> > to consistently use repr (%r) -- they weren't readable otherwise.

> Interesting.  This is worth knowing -- the "fill with null bytes" is
> holy dogma on Unix.

And it's different from Windows in one more respect: it doesn't actually use
diskspace. On UNIX, you *can't* see "whatever trash happened to be on disk",
because the sections you seek()ed past before writing aren't actually on
disk. They're 'holes' in the files, and reading the holes gives the blackest
emptyness available ;)

(btw, the bytes are NUL, not NULL ;)

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!