# CArchive

from direct.pyinst.carchive import CArchive

An Archive subclass that an hold arbitrary data.
Easily handled from C or from Python.

## Inheritance:

CArchive:

## Methods of CArchive:

__init__
add
checkmagic
contents
extract
loadtoc
openEmbedded
save_toc
save_trailer

__init__ def __init__(self, path=None, start=0, len=0) Constructor. PATH is path name of file (create an empty CArchive if path is None). START is the seekposition within PATH. LEN is the length of the CArchive (if 0, then read till EOF).

add def add(self, entry) Add an ENTRY to the CArchive. ENTRY must have: entry[0] is name (under which it will be saved). entry[1] is fullpathname of the file. entry[2] is a flag for it's storage format (0==uncompressed, 1==compressed, 2==Python source format) entry[3] is the entry's type code.

checkmagic def checkmagic(self) Verify that self is a valid CArchive. Magic signature is at end of the archive.

contents def contents(self) Return the names of the entries

extract def extract(self, name) Get the contents of an entry. NAME is an entry name. Return the tuple (ispkg, contents). For non-Python resoures, ispkg is meaningless (and 0). Used by the import mechanism.

loadtoc def loadtoc(self) Load the table of contents into memory.

openEmbedded def openEmbedded(self, name) Open a CArchive of name NAME embedded within this CArchive.

save_toc def save_toc(self, tocpos) Save the table of contents to disk.

save_trailer def save_trailer(self, tocpos) Save the trailer to disk. CArchives can be opened from the end - the trailer points back to the start.