This function opens an existing SPK ephemeris file in order to append ephemeris data to it, whose pathname is the string pointed to by filename, and returns an ephemeris descriptor associated to it. If the file doesn't exist, or if it isn't a SPK file, the function fails and returns NULL. This file must be compliant to the format specified by the 'SPICE' SPK ephemeris file.
The function writeph_close() must be called to flush data to the disk and to free memory allocated by this function.
The following example appends data to the ephemeris file ephemeris.bsp
t_writephbin *weph;
const char segid[] = "seg_asteroid_1";
weph = writeph_spk_open("ephemeris.bsp");
if (weph)
{
/*
... computation and writing to weph ...
*/
writeph_close(weph);
}