Platforms to show: All Mac Windows Linux Cross-Platform

Back to ArchiveReaderMBS class.

ArchiveReaderMBS.AddPassphrase(passphrase as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 19.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Adds a password to the archive.

ArchiveReaderMBS.AppendFilter(Filter as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 19.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Adds a filter to the reader manually.

This is useful to bypass the bidding process when the format and filters to use is known in advance.
Lasterror property is set.

ArchiveReaderMBS.AppendFilterProgram(Program as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 19.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Adds a filter program.

Lasterror property is set.

ArchiveReaderMBS.Close

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 19.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Close the file and release most resources.

Lasterror property is set.

ArchiveReaderMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 16.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The constructor.
Example
Var a as new ArchiveReaderMBS
a.SupportFilterAll
a.SupportFormatAll
a.SetOptions "hdrcharset=UTF-8" // for unicode file names

To create an archive:
1) Ask Constructor for an archive writer object.
2) Set any global properties. In particular, you should set the compression and format to use.
3) Call one of the open methods to open the file (most people will use OpenFile, which provide convenient canned I/O callbacks for you).
4) For each entry, construct an appropriate ArchiveEntryMBS object, call WriteHeader to write the header, call WriteData methods to write the entry data.
5) call close method to close the output

ArchiveReaderMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 16.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The destructor.

ArchiveReaderMBS.Extract(Entry as ArchiveEntryMBS, DestArchive as ArchiverMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 19.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Convenience function to recreate the current entry (whose header has just been read) on disk.

This does quite a bit more than just copy data to disk. It also:

  • Creates intermediate directories as required.
  • Manages directory permissions: non-writable directories will be initially created with write permission enabled; when the archive is closed, dir permissions are edited to the values specified in the archive.
  • Checks hardlinks: hardlinks will not be extracted unless the linked-to file was also extracted within the same session. (TODO)
Lasterror property is set.

See also:

ArchiveReaderMBS.Extract(Entry as ArchiveEntryMBS, flags as Integer = &h123F7)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 19.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Convenience function to recreate the current entry (whose header has just been read) on disk.

This does quite a bit more than just copy data to disk. It also:

  • Creates intermediate directories as required.
  • Manages directory permissions: non-writable directories will be initially created with write permission enabled; when the archive is closed, dir permissions are edited to the values specified in the archive.
  • Checks hardlinks: hardlinks will not be extracted unless the linked-to file was also extracted within the same session. (TODO)
The "flags" argument selects optional behavior, 'OR' the flags you want.
Lasterror property is set.

See also:

ArchiveReaderMBS.NextHeader(entry as ArchiveEntryMBS = nil) as ArchiveEntryMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 16.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads next header.

If you pass in an existing entry, we can recycle the object.
Returns nil in case of error.
Lasterror property is set.

Some examples using this method:

ArchiveReaderMBS.OpenData(Data as String) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 16.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Opens an archive from memory.

Returns true on success and false on failure.
Lasterror property is set.

ArchiveReaderMBS.OpenFile(File as FolderItem, BlockSize as Integer = 10240) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 16.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Opens an archive from a folderitem.

Returns true on success and false on failure.
Lasterror property is set.

See also:

ArchiveReaderMBS.OpenFile(Files() as FolderItem, BlockSize as Integer = 10240) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 19.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Use this for reading multivolume files by filenames.

Returns true on success and false on errors.
Lasterror property is set.

See also:

ArchiveReaderMBS.OpenPath(Path as String, BlockSize as Integer = 10240) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 19.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Opens the file at the given path.

Lasterror property is set.

See also:

ArchiveReaderMBS.OpenPath(Paths() as String, BlockSize as Integer = 10240) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 19.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Use this for reading multivolume files by filenames.

Returns true on success and false on errors.
Lasterror property is set.

See also:

ArchiveReaderMBS.ReadDataBlockMemory(byref offset as Int64) as MemoryBlock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 19.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads next block of data.

Size is given by archive reader used.
Offset is given so you know where you are in the file currently.
Data returned as new memory block.
Lasterror property is set.

A zero-copy version of archive_read_data that also exposes the file offset of each returned block. Note that the client has no way to specify the desired size of the block. The API does guarantee that offsets will be strictly increasing and that returned blocks will not overlap.

ArchiveReaderMBS.ReadDataBlockString(byref offset as Int64) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 19.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads next block of data.

Size is given by archive reader used.
Offset is given so you know where you are in the file currently.
Data returned as new string.
Lasterror property is set.

A zero-copy version of archive_read_data that also exposes the file offset of each returned block. Note that the client has no way to specify the desired size of the block. The API does guarantee that offsets will be strictly increasing and that returned blocks will not overlap.

ArchiveReaderMBS.ReadDataMemory(ByteCount as Integer) as MemoryBlock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 16.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads data from current file into memoryblock.

Lasterror property is set.

ArchiveReaderMBS.ReadDataString(ByteCount as Integer) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Archive MBS Compression Plugin 16.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads data from current file into string.

Lasterror property is set.

Some examples using this method:

The items on this page are in the following plugins: MBS Compression Plugin.


The biggest plugin in space...