David Townshend <[email protected]> added the comment:
It is already possible to write a wrapper function that does it:
def create(file):
fd = os.open(file, os.O_EXCL | os.O_CREAT | os.O_WRONLY)
return os.fdopen(fd)
The point it not that it can't be done, but that it is not straight forward.
The docs say this about os.open(): "This function is intended for low-level
I/O. For normal usage, use the built-in function open()"
I wouldn't call creating a new file low-level I/O, but it is normal usage.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue12760>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com