|
|
The FCLOSE intrinsic terminates access to a file. The disposition
and the security code parameters control the file's retention and
its authorized users. When closing an existing file, you usually
close it with both parameters set to zero.
FCLOSE(FILNUM,0,0)
You cannot change an existing permanent file to a temporary file using the
FCLOSE intrinsic. A temporary file, however, can be closed
as a permanent file by specifying the domain in the disposition
field. To close a newly created temporary file, set the disposition parameter
(bits 13:3) to 1 to save it as a permanent file, or 2 or 3 to keep
it as a temporary file. Note that the disk space bit of the disposition
parameter ( bits 11:2 ) should not be used for a KSAM file.
FCLOSE(FILNUM,1,0)
The security code parameter (seccode) specifies the level of
access security assigned to the file. It is set only for a permanent file. A
value of 1 gives you exclusive access to the file; 0 allows access by other
users. Regardless of the value assigned to the seccode
parameter when closing an existing file, the type of security applied to the
file when it was created is maintained.
In the following example, a new file is closed and saved as a permanent file in
the system file domain (disposition = 1), and access to the
file is restricted to the file's creator (seccode = 1).
FCLOSE(FILENUM,1,1)
|