Message147205
| Author | David.Townshend |
|---|---|
| Recipients | Arfrever, David.Townshend, Julian, amaury.forgeotdarc, benjamin.peterson, docs@python, neologix, pitrou, vstinner |
| Date | 2011-11-07.06:53:29 |
| SpamBayes Score | 1.532493e-06 |
| Marked as misclassified | No |
| Message-id | <1320648810.3.0.643250137336.issue12760@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
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. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2011-11-07 06:53:30 | David.Townshend | set | recipients: + David.Townshend, amaury.forgeotdarc, pitrou, vstinner, benjamin.peterson, Arfrever, neologix, docs@python, Julian |
| 2011-11-07 06:53:30 | David.Townshend | set | messageid: <1320648810.3.0.643250137336.issue12760@psf.upfronthosting.co.za> |
| 2011-11-07 06:53:29 | David.Townshend | link | issue12760 messages |
| 2011-11-07 06:53:29 | David.Townshend | create | |