Espaces de noms
Variantes

tmpnam

De cppreference.com
< c | io

<metanoindex/>

 
 
Fichier d'entrée / sortie
Fonctions
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Déposer accès
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.
Entrée / sortie directe
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
Entrée non formatée / sortie
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.
Mise en forme d'entrée / sortie
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.
Fichier de positionnement
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
Erreur de manipulation
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
Les opérations sur les fichiers
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
 
<tbody> </tbody>
Déclaré dans l'en-tête <stdio.h>
char *tmpnam( char *filename );
Crée un nom de fichier unique et le stocke dans la chaîne de caractères pointée par filename. La fonction est capable de générer jusqu'à TMP_MAX des noms de fichiers uniques, mais tout ou partie d'entre eux peut être utilisé dans le système de fichiers et donc pas les valeurs de retour appropriés .
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.

Paramètres

filename -
le pointeur de chaîne de caractères à utiliser comme un tampon de résultat. Si NULL est passé, un pointeur vers une mémoire tampon interne statique est retourné .
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.

Retourne la valeur

filename si filename n'était pas NULL. Sinon, un pointeur vers un tampon interne statique est renvoyé. Si aucun fichier approprié peut être générée, est renvoyé 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.

Exemple

#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);
}

Résultat :

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

Voir aussi

renvoie un pointeur vers un fichier temporaire
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.

(fonction) [edit]