Re: How to control permission of file?



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


Attachment: signature.asc
Description: OpenPGP digital signature



Relevant Pages

  • Re: How to control permission of file?
    ... does one control that file's permissions (it's "mode" in Unix ... It returns a file descriptor, and if you need a file object you can use ...
    (comp.lang.python)
  • Re: Problem with the select() function and multiple file descriptors
    ... > control and stops the selectfunction from seeing input on the other ... forget to initialize the file descriptor sets. ...
    (comp.os.linux.development.apps)
  • Re: symlinks with permissions
    ... permissions on the path to the file). ... Are you trying to argue how Linux *should* work, ... refuse to expose a way to upgrade a read-only file descriptor to ... some way to upgrade a O_RDONLY file descriptor into O_RDWR mode based on ...
    (Linux-Kernel)
  • Re: symlinks with permissions
    ... permissions on the path to the file). ... does not matter one horse's pitutte what the mode bits on a or b ... my read-only file descriptor to a read-write file descriptor. ... then we'd darn well consider that a security violation. ...
    (Linux-Kernel)
  • Re: How to control permission of file?
    ... Under Unix, it's a bitmapped value that determines what the ... access permissions are for the file. ... other-read, other-write, other-execute, etc. ... how to control a file's mode when it was created by the builtin ...
    (comp.lang.python)