temp file name

K

km

Hi all,
Is there a way to create a unique file name; safely
i have used os.tmpnam() with python2.4, i warns that the usage is a potential security risk.
tia
KM
 
A

Artur M. Piwko

In the darkest hour on Fri, 17 Dec 2004 17:21:53 +0530,
km said:
Is there a way to create a unique file name; safely
i have used os.tmpnam() with python2.4, i warns that the usage is a potential security risk.

Security risk comes from posix tmpnam itself.
From tmpnam manual:

BUGS
The precise meaning of `appropriate' is undefined; it is unspecified
how accessibility of a directory is determined. Never use this func-
tion. Use mkstemp(3) instead.

Use tempfile.mkstemp() instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,214
Messages
2,571,112
Members
47,706
Latest member
HFWTina07

Latest Threads

Top