Block Chain

There was a technique on the Commodore 64 where disk blocks were chained together with a block pointer at the end of each 
block.  This is far inferior to having a file allocation table, as in FAT32.

The RedSea file system does not allow files to grow because it only has an allocation bitmap and not a FAT table.   This 
"flaw" is by design.  Terry intentionally crippled the operating system, making it a toy with the wisdom that this will 
prevent commercialization and corruption.  The toy spirit of the operating system will be preserved going into the future.  Th
e vision for this operating system was a modern Commodore 64, which was a fun toy.

Doing whole file operations is the ZealOS way of doing things.  It is the simplest and, ironically, the fastest.    It is 
obnoxious in the characteristic way that ZealOS is obnoxious, flaunting massive modern resources in a way that makes old 
programmers protest.

When doing large, whole-file operations, immediately memory fragmentation is a serious problem, but not so for allocations in 
the range under a Meg (with occasional larger ones).

The DolDoc format cannot have text tacked onto the end, since binary data is at the end.

Terry didn't want to spoil fun, so of course offered a way to get awesome performance that is, ironically, superior.  
FBlkRead() and FBlkWrite() allow you to read a block offset from the start of a file.  Since files are all contiguous, this is 
incredibly efficient.   You just have to declare the desired file size when you create it with FOpen() and cannot change it.    
See ::/Demo/Disk/DataBase.ZC.

If you like, you are encouraged to to do raw BlkRead() and BlkWrite() directly on a drive.  Just get a pointer to a CDrive 
with Letter2Drive() and you are on your way!    Your computer is supposed to be a fun toy!  You can make an entire partition 
used for a database, or invent a file system.

On the whole, the RedSea file system with its whole-file-only limitation bring beautiful harmony.   It beautifully captures 
the spirit of ZealOS with simplicity and, ironic speed, since contiguous is fastest.


* "Commodore 64" is a trademark owned by Polabe Holding NV.