File Permission in Unix

Michael Hudson mwh at
Wed Nov 14 19:35:23 CET 2001

Dave Swegen <dswegen at> writes:

> On Wed, Nov 14, 2001 at 07:04:07PM +0200, Amit Weisman wrote:
> > Hi
> > How do one creates a file with specified permissions (e.g. , 777) within
> > Python ?
> os.chmod is your friend. Use os.chown to change ownership of a file.

Or use with appropriate flags if it's important that the file
be created with the appropriate permissions.  Then use os.fdopen to
get a nice friendly file object.


42. You can measure a programmer's perspective by noting his
    attitude on the continuing vitality of FORTRAN.
  -- Alan Perlis,

More information about the Python-list mailing list