- 论坛徽章:
- 0
|
至于为什么没有返回你指定的C:\\ D:\\,文档是这样说的
Availability: Unix, Windows. This function probably shouldn’t be used on Windows, though: Microsoft’s implementation of tmpnam() always creates a name in the root directory of the current drive, and that’s generally a poor location for a temp file (depending on privileges, you may not even be able to open a file using this name).
谢谢解答,但是上面这段只是说os.tmpnam()不能在windows下运行,我试了,的确不行
至于为什么没有返回你指定的C:\\ D:\\,我在上面已经说了:On Unix, the environment variable TMPDIR overrides dir, while on Windows TMP is used
我只是比较困惑,如果按上面所说那么os.tempnam([dir[, prefix]]) 函数中的dir不就没用了,因为他都要被覆盖,除非你没设置TMPDIR变量,是这样吗 |
|