Python's open() passes its two arguments straight to stdio's fopen().
If you C library supports (as it should) fopen(filename, "w") to
create a file, Python's open(filename, 'w') should do so too. If it
doesn't, you have a bug (but the test set tests this case so I
suspect you simply haven't tried hard enough or there is a permission
problem in the directory).
> Also, why are there no flags defined in the posix module?
> Flags like:
>
> O_RDONLY, O_WRONLY, O_RDWR, O_APPEND, O_SYNC, O_APPEND, O_CREAT,
> O_TRUNC, O_EXCL, O_NOCTTY
Probably because I haven't really ever used posix.open() for anything
more complicated than O_RDONLY which can be assumed to 0...
--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>