tmpnam
提供:cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <stdio.h>
|
||
| char *tmpnam( char *filename ); |
||
一意のファイル名を作成し、
filenameが指す文字列に格納します。適切な戻り値関数が一意のファイル名のTMP_MAXまで生成することが可能であるが、それらのいくつかまたはすべては、ファイルシステムの使用中であるかもしれないので、しない. 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.
You can help to correct and verify the translation. Click here for instructions.
目次 |
[編集] パラメータ
| filename | - | 結果バッファとして使用する文字列へのポインタ。
NULLが渡された場合は、内部の静的バッファへのポインタが返されます.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. |
[編集] 値を返します
filenamefilenameがNULLなかった場合。そうでなければ内部の静的バッファへのポインタが返されます。適当なファイル名を生成できない場合、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.
You can help to correct and verify the translation. Click here for instructions.
[編集] 例
#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!
[編集] も参照してください
| 一時ファイルへのポインタを返します 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. (機能) | |
| C++ documentation for tmpnam
| |