8 File Storage

Cataloging Files (CAT)

The CAT (catalog) statement outputs a listing of directory information for a storage medium, including read/write authority, the file owner, the group, and physical specifications.

CAT[ALOG] [catalog spec] [,volume spec] [,file type]

NOTE: The CAT statement is not supported on Windows NT platform

The catalog spec is an optional string expression consisting of 0 to 6 characters, followed by an optional volume specifier. When the catalog spec is specified, only those files whose names begin with that combination of characters are listed.

The optional file type is a four-character string which specifies you want to list only that type of file (for example, PROG, DATA, or FORM).

The catalog listing is sent to the standard output device.

For example, the following CAT statement lists, to the standard output device, all program files on the volume labeled Prog1 whose names begin with Ab:

CAT "Ab,Prog1",PROG
The next example shows a CAT statement and the listing it produces:

CAT",MASTER"
total 3
-rw-rw-rw-   1 john   tstctr       32 Nov 15 17:06 DATA.DATA
-rw-rw-rw-   1 john   tstctr     2816 Nov 15 17:32 FRM.FORM
-rw-rw-rw-   1 john   tstctr     1070 Oct 12 10:59 GAME.PROG
Listed below is an explanation of the columns of a catalog listing:

Access Authorization
Indicates the type of access that is set for the file owner, the group associated with the file, and all others. This could be read (r), write (w), execute (x), or any combination of the three. Taking the above example (-rw-rw-rw-), the first rw- string specifies the access authorized for the file owner, the second (rw-) authorization for the group, and the third (rw-) authorization for all others.
Link Counter
Defines the number of links to a file.
User Id
A one-to-eight character string, defining the file owner.
Group Id
A one-to-eight character string, defining the group that owns the file.
File Size
The size of the file expressed in bytes.
Date
The date the file was last saved.
Time
The time the file was last saved.
Name
The name given to the file when the information is stored on the medium. The file name includes a five-character extension defining what type of file it is (.DATA, .PROG, .ROOT, or .FORM).
NOTE: The CAT statement is tied to the HP-UX command ll (long list). Therefore, messages that occur upon executing a CAT statement are HP-UX messages. For example ERROR 56 indicates that a file was not found, ERROR 170 indicates that the HP-UX ll command failed. If a CAT statement is issued without any parameters and the directory is empty, no files are listed and no message is returned. For more information refer to the HP-UX documentation.


Eloquence Language Manual - 19 DEC 2002