| ftncls_c |
|
Table of contents
Procedureftncls_c ( Close file designated by Fortran unit ) void ftncls_c ( SpiceInt unit ) AbstractClose a file designated by a Fortran-style integer logical unit. Required_ReadingNone. KeywordsFILES Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- unit I Fortran-style logical unit. Detailed_Input
unit is an integer representing a Fortran logical unit.
Fortran logical units are integers which in the Fortran language
play a role analogous to pointers to FILE structures in C. In
Fortran, when a file is opened and a logical unit is associated
with the file, the file and unit are said to be "connected." A
logical unit, once connected to a file, may be used to refer to
the file in Fortran I/O statements.
Detailed_OutputNone. ParametersNone. ExceptionsError free. Files
The file connnected to unit would normally have been opened via a
call to a function generated by running f2c on a Fortran SPICELIB
routine. Examples of such functions are
txtopn_
txtopr_
ParticularsThis function is provided in order to fully support the file I/O interface provided by those CSPICE functions generated by running f2c on Fortran SPICELIB routines. ftncls_c should be used to close files opened by these functions ONLY IF the files in question would normally be closed, after having been opened by a Fortran program, by a Fortran CLOSE statement. If a file has been opened by a function that has a corresponding "close file" function, the latter should be used to close a file. Examples are the DAF and DAS families of functions: DAFs are normally closed via dafcls_ and DAS files are normally closed via dascls_. Examples
1) Extract comments from a DAF-based kernel---an SPK file for
example---into a text file.
#include <string.h>
#include "SpiceUsr.h"
.
.
.
#define SPK "my.bsp"
#define OUTFILE "my.txt"
SpiceInt handle;
SpiceInt unit;
/.
Open a new text file for write access, obtaining a Fortran
logical unit.
./
txtopn_ ( OUTFILE, &unit, strlen(OUTFILE) );
/.
Open the SPK file from which comments are to be extracted.
./
dafopr_ ( SPK, &handle, strlen(SPK) );
/.
Extract comments into the text file.
./
spcec_ ( &handle, &unit );
/.
Close the text file.
./
ftncls_c ( unit );
RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) Version
-CSPICE Version 1.0.1, 14-APR-2021 (JDR)
Edited the header to comply with NAIF standard. Remove non-applicable
entry in -Literature_References.
-CSPICE Version 1.0.0, 24-MAY-1999 (NJB)
Index_Entriesclose file designated by Fortran logical unit |
Fri Dec 31 18:41:07 2021