void dascls_c ( SpiceInt handle )
Close a DAS file.
DAS
DAS
FILES
Variable I/O Description
-------- --- --------------------------------------------------
handle I Handle of an open DAS file.
FTSIZE P Maximum number of simultaneously open DAS files.
handle is the file handle of an open DAS file.
None. See $Particulars for a description of the effect of this
routine.
FTSIZE is the maximum number of DAS files that can be
open at any one time. See the file dasfm.c
for details.
Error free.
1) If `handle' is not the handle of an open DAS file, no error
is signaled.
See the description of input argument `handle' in $Detailed_Input.
This routine provides the primary recommended method of closing an
open DAS file. It is also possible to close a DAS file without
segregating it by calling daswbr_ and dasllc_. Closing a DAS file by
any other means may cause the DAS mechanism for keeping track of
which files are open to fail. Closing a DAS file that has been
opened for writing by any other means may result in the production
of something other than a DAS file.
1) Open a new DAS file called TEST.DAS, add 100 d.p. numbers
to it, and then close the file.
#include "SpiceUsr.h"
#include "SpiceZfc.h"
#include <string.h>
int main()
{
#define NMAX 100
SpiceChar * fname;
SpiceChar * ftype;
SpiceChar * ifname;
SpiceDouble ddata [ NMAX ];
SpiceInt handle;
SpiceInt i;
SpiceInt n;
SpiceInt ncomch;
/.
We'll give the file the same internal file name
as the file's actual name. We don't require any
comment records.
./
fname = "TEST.DAS";
ftype = "TEST";
ifname = fname;
ncomch = 0;
dasonw_ ( (SpiceChar *) fname,
(SpiceChar *) ftype,
(SpiceChar *) ifname,
(integer *) &ncomch,
(integer *) &handle,
(ftnlen ) strlen(fname),
(ftnlen ) strlen(ftype),
(ftnlen ) strlen(ifname) );
for ( i = 0; i < NMAX; i++ )
{
ddata[i] = (SpiceDouble)i;
}
n = NMAX;
dasadd_ ( &handle, &n, ddata );
dascls_c ( handle );
return ( 0 );
}
None.
None.
N.J. Bachman (JPL)
K.R. Gehringer (JPL)
W.L. Taber (JPL)
-CSPICE Version 1.0.0, 05-OCT-2006 (NJB) (KRG) (WLT)
close a DAS file
Link to routine dascls_c source file dascls_c.c
|