A file handle is a reference to a data file, system file, or portable file. Most often, a file handle is specified as the name of a file as a string, that is, enclosed within ‘'’ or ‘"’.
A file name string that begins or ends with ‘|’ is treated as the
name of a command to pipe data to or from. You can use this feature
to read data over the network using a program such as ‘curl’
GET '|curl -s -S http://example.com/mydata.sav'), to
read compressed data from a file using a program such as ‘zcat’
GET '|zcat mydata.sav.gz'), and for many other
pspp also supports declaring named file handles with the
HANDLE command. This command associates an identifier of your choice
(the file handle's name) with a file. Later, the file handle name can
be substituted for the name of the file. When pspp syntax accesses a
file multiple times, declaring a named file handle simplifies updating
the syntax later to use a different file. Use of
FILE HANDLE is
also required to read data files in binary formats. See FILE HANDLE,
for more information.
In some circumstances, pspp must distinguish whether a file handle
refers to a system file or a portable file. When this is necessary to
read a file, e.g. as an input file for
pspp uses the file's contents to decide. In the context of writing a
file, e.g. as an output file for
decides based on the file's name: if it ends in ‘.por’ (with any
capitalization), then pspp writes a portable file; otherwise, pspp
writes a system file.
INLINE is reserved as a file handle name. It refers to the “data
file” embedded into the syntax file between
BEGIN DATA and
END DATA. See BEGIN DATA, for more information.
The file to which a file handle refers may be reassigned on a later
FILE HANDLE command if it is first closed using
HANDLE. See CLOSE FILE HANDLE, for