[Python-checkins] CVS: python/dist/src/Lib/test test_largefile.py,1.7,1.8
Thu, 06 Sep 2001 14:03:41 +0200
On Thu, Sep 6 2001 Thomas Wouters wrote:
> 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 ;)
This depends on the implementation of the file system. It's true,
traditionally these gaps don't correspond to disk blocks, but e.g. the
SGI XFS file system does actually allocate disk blocks when you seek
past the end of a file.
> (btw, the bytes are NUL, not NULL ;)
> Thomas Wouters <firstname.lastname@example.org>
> Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
> Python-checkins mailing list
-- Sjoerd Mullender <email@example.com>