Copying Files And Volumes - HP 9000 200 Series Manual

Using the basic 5.0/5.1 system
Table of Contents

Advertisement

Locking and Unlocking SRM Files
You can "lock" an SRM file with the LOCK statement, giving you sole access to that file.
The same file can be locked several times in succession. Unlocking a file requires that you
cancel all locks on that file. If you use the UNLOCK statement, you must cancel each
LOCK with a corresponding UNLOCK. Using ASSIGN to re-open a locked file unlocks
the file and you must execute another LOCK statement to lock the file again. Closing
the file via ASSIGN
@ ...
TO
*
cancels all locks on the file.
In this example, a critical operation must be performed on the file named
File_a,
and
you do not want other users accessing the file during that operation. The program might
be as follows:
1000
ASSIGN
~File
TO "File_a:REMOTE"
1010
LOCK
~File;CONDITIONAL
Result_code
1020
IF Result code THEN GOTO 1010
!
Try again
1030
Begin critical process
2000
End critical process
2010
UNLOCK
~File
The numeric variable called
Result_code
is used to determine the result of the LOCK
operation. If the LOCK operation is successfuL the variable contains O. If the LOCK is
not successful, the variable contains the numeric error code generated by attempting to
lock the file.
Copying Files and Volumes
The COPY statement allows you to duplicate an individual file or an entire disc volume.
Any type of fil£' may be copied.
• Copying a file duplicates the existing file and places the new file name in the
directory.
COpy "ExistFile" TO "NewFile"
A new file can be created either on the same volume or
OIl
another volume.
If
you copy a file to the same volume, the new file name must be different from the
existing file name if it is in the same directory. If there is not enough room on the
disc for the file to be copied, the system cancels the statement and reports an error.
• Copying an entire volume makes an image copy of the source volume on the
destination volume. This type of copy is allowed with LIF and HFS volumes.
5-32
U sing Directories and Files

Advertisement

Table of Contents
loading

This manual is also suitable for:

9000 300 series

Table of Contents