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

PFile work



Ok, PFile is in a reasonable shape again now. That of course doesn't mean I
tried compiling it ;)

I fixed the file/dir attribute stuff the basic write access to Paks. The
serialization code is still untouched. Bjarke, can you have a look at it?
It would be nice if you could do the changes to the ser... code while I
adapt ppfCopy () and fix the memory leak in ppfStat () (the docs need some
serious overhaul as well).

You can get a FILE * pointing to the start of the PakArchive's DirInfo part
via PakArchive::GetDirHandle ().


This is the layout of the Pak data structures as I'd like it (open for
comments of course):

(1) Directory:

"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)


File position is in "content space" (PakFile::m_dataPos is set correctly)
Dir positions are in "dirinfo space"

You might have to add an m_entryPos field to PakDirectory so that it can
correctly write the dir position thing


	Christian

PS: I completely disabled delayed writing for files. That means that (1)
PakFile::SerialiteContentTo () is a no-op and (2) You can assume that at
serialization time all contained files are completely written (and all are
closed)

-- 

Drive A: not responding...Formatting C: instead