close
Namensräume
Varianten

tmpnam

Aus cppreference.com
< c | io

<metanoindex/>

 
 
File input/output
Funktionen
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Dateizugriff
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.
Direkte Eingabe / Ausgabe
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
Unformatierte Eingang / Ausgang
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.
Formatierte Eingabe / Ausgabe
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.
Datei Positionierung
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
Fehlerbehandlung
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
Operationen auf Dateien
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>
definiert in Header <stdio.h>
char *tmpnam( char *filename );
Erstellt einen eindeutigen Dateinamen und speichert sie in der Zeichenkette, auf die filename. Die Funktion ist in der Lage bis zu der einzigartigen Dateinamen TMP_MAX, aber einige oder alle von ihnen können im Gebrauch in dem Dateisystem sein und somit nicht geeignet Rueckgabewerte .
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.

Parameter

filename -
Zeiger auf die Zeichenkette als Ergebnis Puffer verwendet werden. Wenn NULL übergeben wird, wird ein Zeiger auf eine interne statische Puffer zurückgegeben .
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.

Rückgabewert

filename wenn filename nicht NULL. Andernfalls wird ein Zeiger auf einen internen statischen Puffer zurückgegeben. Wenn keine geeignete Dateinamen erzeugt werden kann, wird zurückgegeben 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.

Beispiel

#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!

Siehe auch

liefert einen Zeiger auf eine temporäre Datei
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.

(Funktion) [edit]