Message142193
| Author |
David.Townshend |
| Recipients |
David.Townshend, docs@python |
| Date |
2011年08月16日.13:49:16 |
| SpamBayes Score |
0.00048738773 |
| Marked as misclassified |
No |
| Message-id |
<1313502559.06.0.415498401391.issue12760@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Currently, opening a file with open(file, 'w') overwrites existing files. It would be useful for open() to raise an error when the file exists. This proposal is to add a 'c' mode to open, which has the effect to creating a file and opening it for writing, but raising an IOError if it already exists (i.e. the same as os.open(file, os.O_EXCL|os.O_CREAT).
The attached patch implements this, including tests and documentation. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年08月16日 13:49:19 | David.Townshend | set | recipients:
+ David.Townshend, docs@python |
| 2011年08月16日 13:49:19 | David.Townshend | set | messageid: <1313502559.06.0.415498401391.issue12760@psf.upfronthosting.co.za> |
| 2011年08月16日 13:49:18 | David.Townshend | link | issue12760 messages |
| 2011年08月16日 13:49:18 | David.Townshend | create |
|