tempfile.c File Reference

#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#include <grass/gis.h>

Include dependency graph for tempfile.c:

Go to the source code of this file.

Functions

char * G_tempfile (void)
 returns a temporary file name
char * G__tempfile (int pid)
int G__temp_element (char *element)


Function Documentation

int G__temp_element ( char *  element  ) 

Definition at line 75 of file tempfile.c.

References G__machine_name(), G__make_mapset_element(), and NULL.

Referenced by G__tempfile().

char* G__tempfile ( int  pid  ) 

Definition at line 54 of file tempfile.c.

References G__file_name(), G__temp_element(), G_mapset(), G_store(), and name.

Referenced by G_tempfile().

char* G_tempfile ( void   ) 

returns a temporary file name

This routine returns a pointer to a string containing a unique file name that can be used as a temporary file within the module. Successive calls to G_tempfile() will generate new names. Only the file name is generated. The file itself is not created. To create the file, the module must use standard UNIX functions which create and open files, e.g., creat() or fopen(). The programmer should take reasonable care to remove (unlink) the file before the module exits. However, GRASS database management will eventually remove all temporary files created by G_tempfile() that have been left behind by the modules which created them.

Returns:
char: pointer to a character string containing the name. the name is copied to allocated memory and may be released by the unix free () routine.

Definition at line 49 of file tempfile.c.

References G__tempfile().

Referenced by G_ask_datum_name(), G_ask_ellipse_name(), G_ask_proj_name(), and G_put_cell_title().


Generated on Sun Apr 6 17:32:26 2008 for GRASS by  doxygen 1.5.5