tmpnam函数

Searching…

www.runoob.com

C 库函数 – tmpnam () | 菜鸟教程

C 库函数 - tmpnam () C 标准库 - 描述 C 库函数 char *tmpnam (char *str) 生成并返回一个有效的临时文件名,该文件名之前是不存在的。如果 str 为空,则只会返回临时文件名。 声明 下面是 tmpnam () 函数的声明。 char *tmpnam (char *str) 参数 str -- 这是一个指向字符数组的指针,其中,临时文件名将被存..

en.cppreference.com

std:: tmpnam - cppreference.com

Sep 13, 2023 · Notes Although the names generated by std::tmpnam are difficult to guess, it is possible that a file with that name is created by another process between the moment std::tmpnam returns and the moment th...

learn.microsoft.com

_tempnam, _wtempnam, tmpnam, _wtmpnam | Microsoft Learn

Feb 17, 2023 · _tempnam and tmpnam automatically handle multibyte-character string arguments as appropriate, recognizing multibyte-character sequences according to the OEM code page obtained from the operating system....

zhuanlan.zhihu.com

函数tmpnam和tmpfile的用法 - 知乎

tmpnam ()的s如果为NULL,则返回值存放到一个静态的区中。 如果s不为NULL,则认为其指向长度至少为L_tmpnam个数的字符数组中。

cppreference.cn

tmpnam, tmpnam_s - cppreference.cn - C++参考手册

注意 尽管 tmpnam 生成的名称难以猜测,但在 tmpnam 返回和程序尝试使用返回的名称创建文件之间,仍可能存在另一个进程创建同名文件的情况。 标准函数 tmpfile 和 POSIX 函数 mkstemp 没有此问题(仅使用标准 C 库创建唯一目录仍然需要使用 tmpnam)。

www.standards.wiki

tmpnam函数 C语言 | 标准维基

tmpnam函数生成表示有效文件名的字符串,生成的文件名不同于现有文件名。如果不能生成合适的字符串,函数返回空指针;如果参数s是空指针,函数使用内部静态对象存储生成字符串,并返回指向该对象的指针;如果参数s不是空指针,参数s指向长度至少为L_tmpnam的char类型数组,生成的字符串写入该 ...

c.biancheng.net

C语言tmpnam ()函数:产生一个唯一的包含路径的文件名

L_tmpnam是在stdio.h中定义的宏,指明了tmpnam ()函数产生的文件名的最大长度。 【返回值】成功时返回一个指向保存着文件名的字符数组的指针(如果str不是null,那么返回值与str一样),失败时返回null。

www.apiref.com

std::tmpnam - C++中文 - API参考文档

函数足以生成至多 TMP_MAX 个独有的文件名,但其一些或全部可能已在使用中,从而不适合作为返回值。 std::tmpnam 修改静态状态,而且不要求为线程安全。 参数 filename - 指向足以保有至少 L_tmpnam 字节的字符数组的指针,将以数组为结果缓冲区。

www.man7.org

tmpnam (3) — Linux manual page - man7.org

The tmpnam () function returns a pointer to a string that is a valid filename, and such that a file with this name did not exist at some point in time, so that naive programmers may think it a suitable name for a temp...