HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

4- 114
260 PRINT USING "DD2XZZ"; A, B
300 IMAGE DDD,4A,DD
PROTECT
The PROTECT statement assigns a lockword to a file to protect the file
against unauthorized copying, renaming, and purging. A COPYFILE, RENAME,
or PURGE statement cannot access the file unless it specifies the
associated lockword.
Syntax
PROTECT
fname
[,
lock_word
]
Parameters
fname
The file name. A string expression or literal.
lock_word
A string expression representing a valid file system
lockword. If omitted, any existing lockword is removed.
Examples
PROTECT "File1", "Lock1" !Lock1 is assigned as the lockword for File1.
PROTECT "File1/Lock1","Lock2" !Changes the lockword for File1.
PURGE
The PURGE statement removes a file's name from the directory and releases
its disk space, permanently.
Syntax
[{,} ]
PURGE
fname
[,
lock_word
] [{;} STATUS[=]
num_var
]
Parameters
fname
The PURGE statement removes
fname
from the directory and
releases the disk space that was allocated to that file.
The file data are irretrievably lost.
lock_word
String expression that evaluates to the lockword for
fname
. It is required if the file has a lockword.
num_var
The PURGE statement assigns a zero to
num_var
on
successful completion of the file's removal from the
system; otherwise, a nonzero value is assigned.
A nonzero value represents the file error code returned
by the file subsystem of the MPE XL operating system.
The error number can be translated to an MPE XL file
system error message by looking up the table of file
system error codes in the
MPE XL Intrinsics Reference
Manual
under the FCHECK intrinsic.
Examples
10 CREATE "File1", FILESIZE=1320
20 CREATE "File2", FILESIZE=2950
30 PROTECT "File1", "123ZINC" !Lockword added to File1.
40 PURGE "File1", "123ZINC" !File1 is purged.
50 PURGE "File2" !File2 is purged.
99 END
RAD