<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Thu, 31 Oct 1996 11:17:28 +0000
From   : David Ralph Stacey <drs1@...>
Subject: filing system help

Tom wrote:

> 1. When setting PTR# of a writeable file past the end, is the length
> extended immediately or only when something is written to it? Is the file
> extended with zeros or are the sectors left as they are?

Be careful here. Acorn DFS 0.90 contains quite a serious bug. When moving
the pointer past the end of the writeable file, DFS 0.90 wrote zeros between
the old pointer and the new pointer, thus trashing the end of the file. Eg:

File is 0x500 bytes long, opened for writing and file pointer is currently
0x400. File pointer is changed to 0x600. DFS 0.90 would write zeros from
0x400
to 0x5ff inc., trashing the last 0x100 bytes of the file.

The standard way for programmers to get round this was to move the file
pointer to the end of the file and then move the pointer again to the
required
position.

Acorn DFS releases 1.00 and above corrected this by padding with zeros only
from the end of the file as you suspected.

Dave Stacey



<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>