void dashfn_c ( SpiceInt handle,
SpiceChar * fname )
Return the name of the DAS file associated with a handle.
Variable I/O Description
-------- --- --------------------------------------------------
handle I Handle of a DAS file.
namlen I Length of output file name string.
fname O Corresponding file name.
handle is the handle of a previously opened DAS file.
namlen is the count of characters in the output string,
including room for the terminating null character.
fname is the name of the DAS file associated with the input
1) If the specified handle does not belong to any file that is
currently known to be open, the error SPICE(DASNOSUCHHANDLE)
2) If the output argument pointer is null, the
error SPICE(NULLPOINTER) will be signaled.
3) If the output string length argument is less than 1, the
error SPICE(STRINGTOOSHORT) will be signaled.
4) If the output string has length at least 1 but is too short to
contain the output string, the corresponding is truncated on the
right. The output string is still null-terminated.
See the description of the argument `handle' in $Detailed_Input.
It may be desirable to recover the names of one or more DAS
files in a different part of the program from the one in which
they were opened. Note that the names returned by dashfn_c may
not be identical to the names used to open the files. Under
most operating systems, a particular file can be accessed using
many different names. dashfn_c returns one of them.
In the following program, the name of a DAS file is
recovered using the handle associated with the file.
Example code begins here.
Load a DAS file; map the handle to a file name.
#define DAS "phobos512.bds"
#define FILSIZ 256
SpiceChar fname [ FILSIZ ];
Open the DAS file for read access.
dasopr_c ( DAS, &handle );
Map the handle to a file name.
dashfn_c ( handle, FILSIZ, fname );
printf ( "DAS file name = <%s>.\n", fname );
return ( 0 );
When this program was executed on a PC/Linux/gcc 64-bit platform,
the output was:
DAS file name = <phobos512.bds>.
N.J. Bachman (JPL)
K.R. Gehringer (JPL)
W.L. Taber (JPL)
I.M. Underwood (JPL)
-CSPICE Version 1.0.0, 10-DEC-2016 (NJB)(KRG)(WLT)(IMU)
map DAS handle to file name