.\" -*- nroff -*- .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH TEMPFILE 1 "27 giugno 2012" Debian .SH NOME tempfile \- crea un file temporaneo in maniera sicura .SH SINTASSI \fBtempfile\fP [\-d DIR] [\-p STRINGA] [\-s STRINGA] [\-m MODALITÀ] [\-n FILE] [\-\-directory=DIR] [\-\-prefix=STRINGA] [\-\-suffix=STRINGA] [\-\-mode=MODALITÀ] [\-\-name=FILE] [\-\-help] [\-\-version] .SH DESCRIZIONE .PP \fBtempfile\fP creates a temporary file in a safe manner. It uses \fBmkstemps\fP(3) to choose the name and opens it with O_RDWR | O_CREAT | O_EXCL. The filename is printed on standard output. .PP The directory in which to create the file might be searched for in this order: .TP 3 a) Se la variabile d'ambiente \fBTMPDIR\fP esiste e contiene il nome di una directory appropriata, viene usata tale directory. .TP b) Altrimenti, se viene specificato un appropriato argomento \fI\-\-directory\fP, viene usato tale argomento. .TP c) Altimenti, viene usata \fIP_tmpdir\fP (come definita in \fI\fP) quando è appropriata. .TP d) Da ultimo può essere usata una directory \fI(/tmp)\fP definita dall'implementazione. .SH OPZIONI .TP \fB\-d, \-\-directory \fP\fIDIR\fP Posiziona il file in DIR. .TP \fB\-m, \-\-mode \fP\fIMODALITÀ\fP Apre il file con MODALITÀ invece di 0600. .TP \fB\-n, \-\-name \fP\fIFILE\fP Usa FILE come nome invece di \fBtempnam\fP(3)\fB.\fP Se viene specificata questa opzione le opzioni \-d, \-p e \-s vengono ignorate. .TP \fB\-p, \-\-prefix \fP\fISTRINGA\fP Usa fino a cinque lettere di STRINGA per generare il nome. .TP \fB\-s, \-\-suffix \fP\fISTRINGA\fP Genera il file con STRINGA come suffisso. .TP \fB\-\-help\fP Stampa un messaggio sull'uso sullo standard output e termina con successo. .TP \fB\-\-version\fP Stampa informazioni sulla versione sullo standard output e termina con successo. .SH "VALORI RESTITUITI" Uno stato di uscita 0 significa che il file temporaneo è stato creato con successo. Qualsiasi altro stato di uscita indica un errore. .SH BUG La creazione esclusiva non è garantita quando si creano file su partizioni NFS. tempfile non può creare directory temporanee. tempfile è deprecato; si dovrebbe usare mktemp(1) al suo posto. .SH ESEMPIO .RS .nf #!/bin/sh #[...] t=$(tempfile) || exit trap "rm \-f \-\- '$t'" EXIT #[...] rm \-f \-\- "$t" trap \- EXIT exit .fi .SH "VEDERE ANCHE" \fBtempnam\fP(3), \fBmktemp\fP(1)