SpiceBoolean exists_c ( ConstSpiceChar * fname )
Determine whether a file exists.
None.
FILES
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
fname I Name of the file in question.
The function returns the value SPICETRUE if the file exists,
SPICEFALSE otherwise.
fname is the name of the file in question. This may be
a system name, e.g.
"DISK:[USER.SUB1.SUB2]DATA.DAT"
"\usr\dir1\dir2\data.dat"
or a logical name, e.g.
"EPHEMERIS"
"DATA$DIR:SAMPLE.DAT"
The function returns the value SPICETRUE if the file exists,
SPICEFALSE otherwise.
None.
1) If the input name is blank, the error SPICE(BLANKFILENAME) will
be signalled. (This test is currently unimplemented.)
2) If an error occurs during the execution existence test,
the error SPICE(INQUIREFAILED) is signalled.
None.
Uses the f2c I/O libraries to implement the existence test.
The following code fragment illustrates the use of exists_c.
if ( exists_c ( file ) )
{
update ( file );
}
else
{
setmsg_c ( "Input file does not exist." );
sigerr_c ( "FILENOTFOUND" );
return;
}
None.
None.
K.R. Gehringer (JPL)
H.A. Neilan (JPL)
I.M. Underwood (JPL)
-CSPICE Version 1.1.0, 08-FEB-1998 (NJB)
References to C2F_CreateStr_Sig were removed; code was
cleaned up accordingly. String checks are now done using
the macro CHKFSTR_VAL.
-CSPICE Version 1.0.0, 25-OCT-1997 (NJB)
Based on SPICELIB Version 2.1.0, 4-MAR-1996 (KRG)
does the file exist
Link to routine exists_c source file exists_c.c
|