Partition Export

Command line:
tlapi ‑cEXPPART [‑osArchive] [‑OsLogFile] sPart
Library call:
nStatus = TLexportPart (sPart, sArchive, sLogFile, 0L)
Scripting call:
sOutFile = ExportPartition (sLocation, sLogFile)

Function

Save an image of a partition in an archive file.

The archive will only contain files from the repository within the partition directory tree. External resources referred to by the partition, such as data files or a DTD, will not be included. When restoring a partition archive it is the user’s responsibility to ensure that these resources are available and in the correct location.

A partition can only be exported if it is at the initial release or has an update phase. This function will return an error if the partition has been committed without creating the next update.

Arguments

sPart

The path to the publication, relative to the repository root. The scripting call uses the Partition property to determine the partition to use.

sArchive

The full pathname used to create the archive file. If the file already exists, it will be replaced by the retrieved data. If the file does not exist, it will be created.

sLogFile

If this is defined a log file will be created if errors occur during the archive creation. Any existing file with this path will be removed. To ensure correct operation this should contain an absolute path if present.

The library and scripting calls ignore this if it is NULL or the empty string.

sLocation

This applies to the scripting interface only. This determines where the archive file is created:

  • If undefined or the empty string, the file is created in a directory designated for temporary files.

  • If it is the path to an existing directory, the file is created in this directory.

  • Otherwise, the file is created using sLocation as a path. Any existing file with this path will be overwritten.

When a file name is generated, it will have extension “.zip”.

For additional command line arguments see “Common Flag Arguments”.

Scripting Call Return

The return value is a string containing the path to the output file. This is always an absolute path. It is also available as the value of the OutputFile property.

If the output cannot be generated, an empty string is returned.

Examples

Command line:

tlapi ‑cEXPPART -opart.zip manuals/guide

Library call:

status = TLexportPart("manuals/guide", "/tmp/ss.zip", 0L, NULL);

Scripting call:

file = topleaf.ExportPartition("/tmp", "");