OPEN ARCHIVE FILE(3P) — SUNPHIGS LIBRARY
NAME
OPEN ARCHIVE FILE − open specified archive file
SYNOPSIS
C Syntax
void
popenarfile ( archive_id, archive_file )
Pintarchive_id;archive identifier
Pchar∗archive_file;archive file name
FORTRAN Syntax
SUBROUTINE poparf ( AFID, ARCFIL )
INTEGERAFIDarchive file identifier
INTEGERARCFILarchive file logical unit number
Required PHIGS Operating States
(PHOP, ∗, ∗, ∗)
DESCRIPTION
Purpose
Use OPEN ARCHIVE FILE to open an archive file and associate a specified archive file identifier with the open archive file.
C Input Parameters
archive_id
An integer specifying the identifier to be associated with the open archive file.
archive_file
A character string giving the file name of the archive file. The application should not open this file, PHIGS will open it when it it needs to access it.
Neither the application nor the operator should attempt to interact with this file after passing it to OPEN ARCHIVE FILE.
FORTRAN Input Parameters
AFIDAn integer specifying the identifier to be associated with the open archive file.
ARCFIL
The logical unit number (LUN) of the physical archive file to use. This LUN must either be associated with an opened and named file or not be assoicated with any file. (It can’t be the LUN associated with standard output for instance.) If the LUN is associated with an open and named file, PHIGS will first close the file and then reopen it when reading from or writing to it. If the logical unit number is not associated with an open file, OPEN ARCHIVE FILE will create a file named fort.lun, where lun is the specified logical unit number.
Neither the application nor the operator should attempt to interact with this logical unit number after passing it to OPEN ARCHIVE FILE.
Execution
If the specified archive file does not exist, a new file will be created and will remain empty until CLOSE ARCHIVE FILE is called. At that time any archived structures will be written to the file.
If the specified file exists, and is a valid SunPHIGS archive file, the contents will be read and available for retrieval. If the named file exists but is empty, it will be treated as if it had not existed, i.e. it will become a valid SunPHIGS archive file and remain empty until it is closed, at which time any archived structures will be written to it.
The physical file is only opened by PHIGS when reading from or writing to it, i.e., during calls to OPEN ARCHIVE and CLOSE ARCHIVE.
The PHIGS archive state is set to "archive open" (AROP) and the specified archive file identifier is added to the "set of open archive files" maintained in the PHIGS state list.
Note: It is recommended that the application leave an archive file open until it will no longer be needed, in order to avoid repeating the overhead associated with the OPEN ARCHIVE FILE operation.
SunPHIGS archives are supported in a private, binary format.
ERRORS
002Ignoring function, function requires state (PHOP, ∗, ∗, ∗)
402Ignoring function, archive file identifier already in use
400Ignoring function, the archive file cannot be opened
401Ignoring function, opening this archive file would exceed the maximum number of simultaneously open archive files
403Ignoring function, the archive file is not a PHIGS archive file
SEE ALSO
ARCHIVE STRUCTURES (3P)
CLOSE ARCHIVE FILE (3P)
INQUIRE ARCHIVE FILES (3P)
INQUIRE ARCHIVE STATE VALUE (3P)
RETRIEVE STRUCTURE IDENTIFIERS (3P)
RETRIEVE STRUCTURES (3P)
DELETE ALL STRUCTURES FROM ARCHIVE (3P)
Sun Release 4.0 — Last change: 7 July 1989