How to control permission of file?

K.S.Sreeram sreeram at tachyontech.net
Fri Jun 30 22:01:04 CEST 2006


Grant Edwards wrote:
> When one open()s a file (that doesn't exist) for writing , how
> does one control that file's permissions (it's "mode" in Unix
> terms).

Check out 'os.open'
It returns a file descriptor, and if you need a file object you can use
'os.fdopen' on the file descriptor

Regards
Sreeram


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20060701/cffc4f90/attachment.sig>


More information about the Python-list mailing list