.TH g.tempfile 1grass "" "GRASS 7.6.0" "Grass User's Manual" .SH NAME \fI\fBg.tempfile\fR\fR \- Creates a temporary file and prints it\(cqs file name. .SH KEYWORDS general, support, scripts .SH SYNOPSIS \fBg.tempfile\fR .br \fBg.tempfile \-\-help\fR .br \fBg.tempfile\fR [\-\fBd\fR] \fBpid\fR=\fIinteger\fR [\-\-\fBhelp\fR] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR] [\-\-\fBui\fR] .SS Flags: .IP "\fB\-d\fR" 4m .br Dry run \- don\(cqt create a file, just prints it\(cqs file name .IP "\fB\-\-help\fR" 4m .br Print usage summary .IP "\fB\-\-verbose\fR" 4m .br Verbose module output .IP "\fB\-\-quiet\fR" 4m .br Quiet module output .IP "\fB\-\-ui\fR" 4m .br Force launching GUI dialog .SS Parameters: .IP "\fBpid\fR=\fIinteger\fR \fB[required]\fR" 4m .br Process id to use when naming the tempfile .SH DESCRIPTION \fIg.tempfile\fR is designed for shell scripts that need to use large temporary files. GRASS provides a mechanism for temporary files that does not depend on /tmp. GRASS temporary files are created in the data base with the assumption that there will be enough space under the data base for large files. GRASS periodically removes temporary files that have been left behind by programs that failed to remove them before terminating. .PP \fIg.tempfile\fR creates an unique file and prints the name. The user is required to provide a process\-id which will be used as part of the name of the file. Most Unix shells provide a way to get the process id of the current shell. For /bin/sh and /bin/csh this is $$. It is recommended that $$ be specified as the process\-id for \fIg.tempfile\fR. .SH EXAMPLE For /bin/sh scripts the following syntax should be used: .br .nf \fC temp1=\(gag.tempfile pid=$$\(ga temp2=\(gag.tempfile pid=$$\(ga \fR .fi For /bin/csh scripts, the following can be used: .br .nf \fC set temp1=\(gag.tempfile pid=$$\(ga set temp2=\(gag.tempfile pid=$$\(ga \fR .fi .SH NOTES Each call to \fIg.tempfile\fR creates a different (i.e. unique) name. Although GRASS does eventually get around to removing tempfiles that have been left behind, the programmer should make every effort to remove these files. They often get large and take up disk space. If you write /bin/sh scripts, learn to use the /bin/sh \fItrap\fR command. If you write /bin/csh scripts, learn to use the /bin/csh \fIonintr\fR command. .SH AUTHOR Michael Shapiro, U.S. Army Construction Engineering Research Laboratory .PP \fILast changed: $Date: 2011\-11\-08 22:24:20 +0100 (Tue, 08 Nov 2011) $\fR .SH SOURCE CODE .PP Available at: g.tempfile source code (history) .PP Main index | General index | Topics index | Keywords index | Graphical index | Full index .PP © 2003\-2019 GRASS Development Team, GRASS GIS 7.6.0 Reference Manual