So you make the virtual file system have a fixed size?
Also looking at:
TBrainVFSBlock = packed record
Size: Word; // rozmiar bloku danych (domyœlnie: 512)
// data block size (default: 512)
Offset: Int64; // offset bloku w pliku. Int64 to m¹dry wyb??r
// block's offset in archive. Int64 is a wide choice here
Flag: Byte; // flaga opisuj¹ca blok:
// (0 - wolny blok, 7 - blok u¿ywany, 23 - blok usuniêty)
// flag describing the block:
// (0 - free block, 7 - dirty block, 23 - block deleted)
end;
Makes me wonder why store size and offset? The idea for fat/ntsf or virtualfilesystem is that all blocks are equal size.
In you case you can number your blocks 1,2,3 etc. The offset can be calculated as: header+(blockid*blocksize).
Thus giving:
TBrainVFSBlock = packed record
BlockId: Int64;
Flag: Byte; //could also be boolean?
end;
Or to go haywire. Only put deleted blocks in FBlocks :-) and assume other blocks are used.
Or are you not planning on splitting up larger files over multiple blocks. I do not see code for that yet in your code.
Be aware on what block together make a file and in what order.
Bookmarks