stat, chmod and RDONLY file (win32)?

Greg Ewing greg.ewing at compaq.com
Tue Aug 17 17:36:54 EDT 1999


"T. C. Mits" wrote:
> 
> mean that one must supply the c-run-time bit flags,
> documented elsewhere (where?), as mentioned in the open() API blurb, such as
> O_RDONLY.

No, O_RDONLY and friends are a completely different set
of modes (confusing, I know!)

The sort of mode you want here consists of 3 octal
digits, for owner, group and other. Each digit
contains read, write and execute permission bits
in that order.

So, to add write permission for the owner, for
instance, "or" the existing permissions with
octal 0200.

There's also a fourth octal digit to the
left which contains the setuid, setgid and
sticky bits, but these aren't relevant for what
you're doing here.

Hope that helps,
Greg




More information about the Python-list mailing list