[Python-Dev] Warn about mktemp once again? (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Tue Apr 29 07:49:33 CEST 2008
- Previous message: [Python-Dev] Warn about mktemp once again?
- Next message: [Python-Dev] Warn about mktemp once again?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Guido van Rossum wrote:
IMO mkstemp() is a major pain because you have to use raw file descriptors on the return value. I'd much rather recommend [Named]TemporaryFile which return streams.
The problem with NamedTemporaryFile is that it deletes the file as soon as you close it, which makes the named-ness of it rather useless, as far as I can see. If you don't want that to happen, you have to use mkstemp.
-- Greg
- Previous message: [Python-Dev] Warn about mktemp once again?
- Next message: [Python-Dev] Warn about mktemp once again?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]