ArchiveCreateEntry

Interface of ArchiveEntry used to create archives

Members

Functions

byChunk
ByteRange byChunk(size_t chunkSize)

A byte range to the content of the entry. Only relevant for regular files. Other types of entry will return an empty range.

readContent
ubyte[] readContent()

Helper function that read the complete data of the entry (using byChunk).

Inherited Members

From ArchiveEntry

mode
EntryMode mode [@property getter]

Tell whether the entry is used for creation (ArchiveCreateEntry) or extraction (ArchiveExtractEntry)

path
string path [@property getter]

The archive mode this entry is for. The path of the entry within the archive. Should always be a relative path, and never go backward (..)

type
EntryType type [@property getter]

The type of entry (directory, file, symlink)

linkname
string linkname [@property getter]

If symlink, this is the path pointed to by the link (relative to the symlink). For directories and regular file, returns null.

size
ulong size [@property getter]

The size of the entry in bytes (returns zero for directories and symlink) This is the size of uncompressed, extracted data.

timeLastModified
SysTime timeLastModified [@property getter]

The timeLastModified of the entry

attributes
uint attributes [@property getter]

The file attributes (as returned std.file.getLinkAttributes)

ownerId
int ownerId [@property getter]

The owner id of the entry

groupId
int groupId [@property getter]

The group id of the entry

isBomb
bool isBomb(ulong allowedSz)

Check if the entry is a potential bomb. A bomb is typically an entry that may overwrite other files outside of the extraction directory. isBomb will return true if the path is an absolute path or a relative path going backwards (containing '..' after normalization). In addition, a criteria of maximum allowed size can be provided (by default all sizes are accepted).

Meta