Date : Fri, 12 Nov 2010 19:49:54 +0100
From : rick@... (Rick Murray)
Subject: RFC: Need two error numbers
On 12/11/2010 16:58, paul aslin wrote:
> But the real answer is simply that ADFS,Level3 FS and others buffer
> writes to the disk, but leave the file marked as open first. Hence
> the data in memory is lost.
And...? I order to format an SD card as NTFS so I could download a file
larger than 2Gb to it, I had to go to the properties tab and make sure
"Optimise for quick removal" was not selected.
You see, modern filesystems tend to buffer writes in memory. This allows
for a variety of optimisations such as collecting together small writes
to the same part of the disc and writes them out in one big lump. There
are even further optimisations for writing to flash-based media where
the cell size is often in the order of 64K-128K so writing small bits of
sequential data could imply constantly erasing and rewriting the same
chunks of flash (though wear levelling would, to a degree, mitigate some
of this).
To a similar degree, the Level3 (etc) file servers will try to buffer
data in order that discs can be written a sector at a time. This is a
lot more efficient when the computer is writing bytes. Recall, to change
a single byte, you would need to:
Read in the entire sector
Alter the byte to be modified
Write back the entire sector
How much more useful to buffer data in memory and group writes as much
as possible. It will, I should point out, additionally be much kinder to
the disc media and hardware.
Best wishes,
Rick.
--
Rick Murray, eeePC901 & ADSL WiFI'd into it, all ETLAs!
BBC B: DNFS, 2 x 5.25" floppies, EPROM prog, Acorn TTX
E01S FileStore, A3000/A5000/RiscPC/various PCs/blahblah...