Get Diagnostic Log or Component File

Command line:
tlapi ‑cGETSTAT ‑tnType ‑psPhase ‑osOutFile sPart
Library call:
nStatus = TLgetstatex (sPart, sPhase, sOutFile, nType)
Scripting call:
sOutFile = GetStatus (sType, sLocation)

Function

Retrieve a diagnostic log file or a partition component file and store it in a text file. Diagnostic log files contain information that describes the exit status for a previous API function call. Component files contain extended status information for a partition (for example, the set of change pages page identifiers) or generated content that can be used as input to another API function call (for example, a list of file pathnames that define a set of changed pages).

Arguments

sPart

The path of the partition from which to retrieve the component or logfile.

sPhase

The phase from which to retrieve the data.

sOutFile

The full pathname of a document file to hold the retrieved status file. If the file already exists, it will be replaced by the retrieved data. If the file does not exist, it will be created.

nType

The following long integer values for nType retrieve a diagnostic log file from a partition:

Type Meaning
0 The composition log file. TopLeaf creates a composition log each time you typeset a partition using the COMPOSE API function.
2 The commit log file. When you publish a partition, TopLeaf creates a new version of the partition content. For full looseleaf and change pages partitions, TopLeaf determines a published page set, and for full looseleaf partitions, a leaf set for the new update. The commit log file contains information regarding the success (or otherwise) of the COMMIT API function.
5 The secondary output log file. A non-empty secondary output log file contains additional information regarding the success (or otherwise) of the GETTRN API function.
9 Auto-export requests include the creation of a generated file (for example, table of contents, index, or Xref table) or running an executable post-processing step. These requests are declared from the TopLeaf GUI partition properties menu. can be processed each time you typeset a partition, or when a partition is published. A non-empty auto-exports log file contains information regarding the success (or otherwise) of the defined auto-export requests.
12 A printer error log file generated when one or more partition page(s) are printed using the PRINT API function.

The following long integer values for nType retrieve a component file from a partition:

Type Meaning
4 a list of all tag and custom marker mappings as an XML file (a TopLeaf .tlf style sheet file format)
6 a list of all pages in the partition (TopLeaf .tpg page list file format)
7 the partition jump destination table (listed as colon separated fields)
8 list of all change pages in the current update (TopLeaf .tpg page list file format)
11 the partition change pages page identifier table
14 the meta-data values generated by the last composition run (XML format)
64 the partition <tl:leaf.list> describing the changed and manual inclusion status for each leaf in a full looseleaf partition (XML format)
sLocation

This applies to the scripting call only. It determines where the output file is created:

  • If null 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 “.dat”.

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 file cannot be created, an empty string is returned.

Examples

Command line:

tlapi ‑cGETSTAT ‑t2 ‑pUPDATE ‑oC:\stat.dat manuals/topix/volume1

Library call:

stat = TLgetstatex("manuals/topix/volume1", "UPDATE", "C:\\stat.dat", 2L);

Scripting call:

file = topleaf.GetStatus(2, "C:\\Temp");