tmpnam

Da cppreference.com.
< c‎ | io

 
 
File input/output
Funzioni
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Accesso ai file
Original:
File access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Diretta input / output
Original:
Direct input/output
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
fread
fwrite
Ingresso formattato / uscita
Original:
Unformatted input/output
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Formattato di input / output
Original:
Formatted input/output
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
File di posizionamento
Original:
File positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ftell
fgetpos
fseek
fsetpos
rewind
La gestione degli errori
Original:
Error handling
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
clearerr
feof
ferror
perror
Le operazioni sui file
Original:
Operations on files
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
remove
rename
tmpfile
tmpnam
 
Elemento definito nell'header <stdio.h>
char*tmpnam(char*filename );
Crea un nome di file univoco e lo memorizza nella stringa di caratteri puntato da filename. La funzione è in grado di generare fino a TMP_MAX di nomi di file unici, ma alcuni o tutti loro potrebbe essere in uso nel file system e quindi non adatti valori di ritorno.
Original:
Creates an unique filename and stores it in character string pointed to by filename. The function is capable of generating up to TMP_MAX of unique filenames, but some or all of them may be in use in the filesystem and thus not suitable return values.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Indice

[modifica]Parametri

filename -
puntatore alla stringa di caratteri da utilizzare come buffer risultato. Se NULL è passato, un puntatore a un buffer interno statico viene restituito .
Original:
pointer to the character string to be used as a result buffer. If NULL is passed, a pointer to an internal static buffer is returned.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica]Valore di ritorno

filenamefilename se non fosse NULL. In caso contrario, un puntatore a un buffer interno statico viene restituito. Se non filename adatto può essere generato, viene restituito NULL.
Original:
filename if filename was not NULL. Otherwise a pointer to an internal static buffer is returned. If no suitable filename can be generated, NULL is returned.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica]Esempio

#include <stdlib.h>#include <stdio.h>#include <stdint.h>#include <stdbool.h>   int main(int argc, char*argv[]){printf("Welcome to %s\n", argv[0]);printf("Called with %u arguments\n", argc -1);   char buffer[L_tmpnam]={'\0'}; tmpnam(buffer);printf(buffer);printf("\n");   printf("Goodbye!\n");exit(EXIT_SUCCESS);}

Output:

Welcome to ./main_release Called with 0 arguments /tmp/file6HADua Goodbye!

[modifica]Vedi anche

restituisce un puntatore a un file temporaneo
Original:
returns a pointer to a temporary file
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(funzione)[modifica]
close