Table of contents
dafrfr_c ( DAF, read file record )
void dafrfr_c ( SpiceInt handle,
SpiceInt * nd,
SpiceInt * ni,
SpiceChar * ifname,
SpiceInt * fward,
SpiceInt * bward,
SpiceInt * free )
Read the contents of the file record of a DAF.
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
handle I Handle of an open DAF file.
ifnlen I Available room in the output string `ifname'.
nd O Number of double precision components in summaries.
ni O Number of integer components in summaries.
ifname O Internal file name.
fward O Forward list pointer.
bward O Backward list pointer.
free O Free address pointer.
handle is the handle assigned to a DAF file opened for
ifnlen is the maximum number of characters that can be
accommodated in the output string `ifname'. This count
includes room for the terminating null character.
DAF internal file names may contain up to 60
characters, so `ifnlen' normally should be set to 61.
ni are the numbers of double precision and integer
components, respectively, in each array summary in
the specified file.
ifname is the internal file name stored in the first
(or file) record of the specified file. `ifname'
should be declared with the length specified by
fward is the forward list pointer. This points to the
first summary record in the file. (Records between
the first record and the first summary record are
reserved when the file is created, and are invisible
to DAF routines.)
DAF list pointers are actually Fortran record numbers,
and as such, start at one.
bward is the backward list pointer. This points
to the final summary record in the file.
free is the free address pointer. This contains the
first free address in the file. (That is, the
initial address of the next array to be added
to the file.)
`free' is a DAF address; for compatibility with
SPICELIB, the range of DAF addresses starts at 1.
1) If the handle passed to this routine is not the handle of an
open DAF file, an error is signaled by a routine in the call
tree of this routine.
2) If the specified DAF file is not open for read access, an
error is signaled by a routine in the call tree of this
3) If the specified record cannot (for some reason) be read, the
error SPICE(DAFFRNOTFOUND) is signaled by a routine in the
call tree of this routine.
The input `handle' should refer to a DAF file open for read
or write access.
The file record of a DAF is the only record that contains
any global information about the file. This record is created
when the file is created, and is updated only when new arrays
Like character records, file records are not buffered.
The numerical results shown for this example may differ across
platforms. The results depend on the SPICE kernels used as
input, the compiler and supporting libraries, and the machine
specific arithmetic implementation.
1) In the following example, the file record of a DAF is read
to determine the first free address in the file.
Use the SPK kernel below as input DAF file for the example.
Example code begins here.
int main ()
#define IFNLEN 61
SpiceChar * kernel = "de421.bsp";
dafopr_c ( kernel, &handle );
dafrfr_c ( handle, IFNLEN, &nd, &ni, ifname, &fward,
&bward, &free );
printf ( "First free DAF address is %d.\n", (int)free );
Safely close the DAF.
dafcls_c ( handle );
return ( 0 );
When this program was executed on a Mac/Intel/cc/64-bit
platform, the output was:
First free DAF address is 2098645.
N.J. Bachman (JPL)
J. Diaz del Rio (ODC Space)
K.R. Gehringer (JPL)
I.M. Underwood (JPL)
E.D. Wright (JPL)
-CSPICE Version 1.1.0, 13-AUG-2021 (JDR)
Changed the input argument name "lenout" to "ifnlen" for
consistency with other routines.
Edited the header to comply with NAIF standard.
-CSPICE Version 1.0.1, 28-JUN-2016 (EDW)
Edit to Example code, SpiceInts output as ints using
-CSPICE Version 1.0.0, 17-JUN-2009 (NJB) (KRG) (IMU)
read DAF file record