PsiFS: File Format Converters

PsiFS Module Example

PsiFS Module Example

An example file format converter configuration for the *PsiFSTar and *PsiFSSIS commands has been included in the directory !PsiFS.Converters.!PsiFS. This allows the contents of tar and SIS files to be extracted or listed.

Please note that since the file format converter interface uses the !Scrap directory to store temporary files, filenames may be truncated unless long filenames are supported on the drive where !Scrap is located.

The following sections describe each of the files within the sub-directory.

!PsiFS

The !PsiFS file tells PsiFS all of the important characteristics of the file format converter.

The first section of the file sets default conversion options, and this is followed by the converter configurations. Multiple converter configurations with different options are specified for each command; this is necessary if different output file types are produced.

The PsiFSCapture alias defined within the !Boot file is used to capture the output from a command to a specified file.

!PsiFSRes

The !PsiFSRes file contains the toolbox template used to select conversion options for SIS files. There are no user selectable options for the conversion of tar files.

A String Set gadget is used to allow selection of the installation drive. It is not possible to generate the list of available options dynamically when the conversion is performed, so a static list offering just drives C and D is specified in the toolbox resource file.

!Boot

The !Boot file is run by PsiFS at start-up using Wimp_StartTask.

This starts by defining the textual version of the supported file types to ensure that the !PsiFS file can be correctly parsed. The file format converter is then registered by defining the system variable PsiFSConverter$PsiFS to point to the current directory. Another system variable PsiFS$ConverterScrap is defined to specify the name of a temporary file. Finally, an alias for PsiFSCapture is defined to run the Capture program, enabling simpler commands to be used within the !PsiFS file.

!Run

The !Run file is not normally run; it is included solely to provide a friendly error message if someone does try to run it.

Capture

The Capture file is a simple BASIC program that executes a command with the output captured to a text file.

This program is used instead of a simple command alias to ensure that the output file is deleted if an error occurs. This behaviour is required by the PsiFS file format converter interface.


[Contents] [Up] Copyright © Alexander Thoukydides, 1998, 1999, 2000