exists_c

Index Page exists_c
A B C D E F G H I J K L M N O P Q R S T U V W X
Procedure Abstract Required_Reading Keywords Brief_I/O Detailed_Input | Detailed_Output Parameters Exceptions Files Particulars Examples | Restrictions Literature_References Author_and_Institution Version Index_Entries
#### Procedure
       SpiceBoolean exists_c ( ConstSpiceChar  * fname )
#### Abstract
       Determine whether a file exists.
#### Required_Reading
       None.
#### Keywords
        FILES
#### Brief_I/O
       VARIABLE  I/O  DESCRIPTION
       --------  ---  --------------------------------------------------
       fname      I   Name of the file in question.

       The function returns the value SPICETRUE if the file exists,
       SPICEFALSE otherwise.
#### Detailed_Input
       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"
#### Detailed_Output
       The function returns the value SPICETRUE if the file exists,
       SPICEFALSE otherwise.
#### Parameters
       None.
#### Exceptions
       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.
#### Files
       None.
#### Particulars
       Uses the f2c I/O libraries to implement the existence test.
#### Examples
       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;
             }
#### Restrictions
       None.
#### Literature_References
       None.
#### Author_and_Institution
       K.R. Gehringer  (JPL)
       H.A. Neilan     (JPL)
       I.M. Underwood  (JPL)
#### Version
       -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)
#### Index_Entries
       does the file exist
#### Link to routine exists_c source file exists_c.c

    Thu Apr 16 08:58:06 2009