The REMOVELFILE entry point removes files without opening them. It corresponds with the ALGOL REMOVEFILE statement, but it does not truncate file names at 17 characters. This allows REMOVELFILE to be used on files that contain long file name nodes.
ALGOL Interface
LIBRARY GENERALSUPPORT(LIBACCESS=BYFUNCTION); BOOLEAN PROCEDURE REMOVELFILE(TITLE); VALUE TITLE; POINTER TITLE; LIBRARY GENERALSUPPORT;
Syntax
── REMOVELFILE ── ( ──<directory element>── ) ─────────────────────────┤
<directory element>
──┬─<pointer expression>─┬─────────────────────────────────────────────┤ └─<array row>──────────┘
Explanation
The REMOVELFILE function returns a value of TRUE if an error occurs. Error numbers, stored in field [39:20] of the result, correspond to the causes of failure as follows.
Value |
Meaning |
10 |
File name or directory element is in error. |
30 |
File names have not been removed. |
Family substitution is used if the task has an active family specification and the family name involved in the REMOVELFILE statement is the target family name that the FAMILY specification substitutes.
If a family substitution specification is in effect, the REMOVELFILE statement affects only the substitute family, not the alternate family.
<directory element>
A directory element is a file name, a directory name, or both a file name and a directory name. A directory name references a group of files. For example, the following files are all in the directory names JAMES. The first six files are in the directory named (JAMES)OBJECT, and the first five files are in the directory named (JAMES)OBJECT/TEST. Note that (JAMES) OBJECT/TEST/PRIMES is both a file name and a directory name.
(JAMES)OBJECT/TEST/COM (JAMES)OBJECT/TEST/SORT (JAMES)OBJECT/TEST/PRIMES (JAMES)OBJECT/TEST/PRIMES/1 (JAMES)OBJECT/TEST/PRIMES/2 (JAMES)OBJECT/LIBRARY1 (JAMES)MEMO
If the directory element is a directory name, all files in that directory are removed. If the directory element is both a file name and a directory name, that file and all files in the directory are removed.
A directory element of the form <file name>/= removes only files in that directory. It does not remove a file named <file name>.
If a pointer expression is used as a directory element, it must point to a literal or an array that contains the name of the file or directory to be removed.
Example
In the following example of a REMOVELFILE, the program removes MYTEST on PACKFOUR.
BEGIN BOOLEAN BOOL; LIBRARY GENERALSUPPORT(LIBACCESS=BYFUNCTION); BOOLEAN PROCEDURE REMOVELFILE(TITLE); VALUE TITLE; POINTER TITLE; LIBRARY GENERALSUPPORT; BOOL := REMOVELFILE(POINTER("MYTEST ON PACKFOUR.")); END.