Guardian Application Conversion Guide

Managing Your Disk Files
Converting Other Parts of an Application
8–8 096047 Tandem Computers Incorporated
Renaming a Disk File
Your existing program might call the RENAME procedure to rename an open disk file:
CALL RENAME (file^number,
new^name);
Convert your program to call the FILE_RENAME_ procedure to rename an open disk
file. If the file is temporary, FILE_RENAME_ causes the file to become permanent.
You must have purge access to the file; otherwise, a security violation (file-system
error 48) occurs.
FILE_RENAME_ requires a string for the new file name rather than the 12-word
internal-format file name. The length of the name is specified by a separate integer
parameter. If the file name is incomplete, FILE_RENAME_ uses the current settings,
including the node name, from the =_DEFAULTS DEFINE for the unspecified parts.
In this example, FILE_RENAME_ renames an open file:
error := FILE_RENAME_(file^number,
new^file^name:new^file^name^length);
Purging a Disk File
Your existing program might call the PURGE procedure to delete a closed disk file:
CALL PURGE (file^name);
Convert your program to call the FILE_PURGE_ procedure to delete the file.
FILE_PURGE_ deletes the disk file name from the volume's directory and makes any
disk space allocated to the file available to other files.
FILE_PURGE_ requires a string for the file name rather than the 12-word internal-
format file name. The length of the name is specified by a separate integer parameter.
If the file name is incomplete, FILE_PURGE_ uses the current settings, including the
node name, from the =_DEFAULTS DEFINE for the unspecified parts.
To delete a file, you must have purge access to the file; otherwise, a security violation
(file-system error 48) occurs. In this example, FILE_PURGE_ deletes a closed file:
error := FILE_PURGE_(file^name:file^name^length);