I've got slight problem with os.tmpfile(). What I would like to do is to get the filedesc of tmpfile. First approach: os.tmpfile().fileno() of course does not work out, because fileno() does not keep object alive. The solution is to keep os.tmpfile() result somewhere for an arbitrary amount of time, which is quite obscure. This is problem with all file operations, but fortunately if I want a filedesc, I can do just os.open() which will not close the file for me. I've got several obscure solutions, noone satisfies me really: * If I use .fileno() than I'm on my own and I need to close file myself * .fileno() returns a int-like object which keeps alive file (well, this will explode when keeping this as an index in a list, which does not keep the object alive and so on) * have os._tmpfile() or whatever which returns filedesc What do you think? Cheers, fijal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-dev/attachments/20070807/eeaa0959/attachment.htm
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4