[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PFile work



> "dir\0"
> <HashTable info (NrOfEntries, HashTableSize, ...)>
> Entry1
> Entry2
> Entry3
> ...
> 
> (2) Directory Entry:
> 
> "dire"
> NameLength (1 Byte)
> Name (Max 255 chars, no trailing \0)
> Attribs (4 Bytes)
> CTime (8 Bytes)
> MTime (8 Bytes)
> FileSize (8 Bytes)  // 0 for dir
> DataSize (8 Bytes)  // 0 for dir
> File/Dir Position (8 Bytes)
> 
The format that is I've implemented PakDirectory to write is this:

----
"dir\0"
Attribs (4 bytes)
NameLength (1 byte)
Name (Max 255 chars, no trailing \0)
Serialized image of file container.
Serialized image of dir container.
----

The reason I moved the name to the end of the block that PakDirectory
directly writes, is that I only 2 reads is needed then (read everything
up to the name, then read the name), whereas having the namesize first,
then the name and then the rest requires 3 reads (read the "dir\0" and
namesize, read the name and finally read the rest).

I removed two lines of code from the PakDirectory constructor that set
the current and modification time to -now-, as the default GenericDir
constructor already does this.

Source coming in priv. mail.

Btw, is it possible for CVS to send E-mail to some address whenever
something is altered (telling precisely what has been altered)? If yes,
we could have a seperate mailing list for that, and people who want to
see what's happening at the code level can. I'd appreciate it.