[Tutor] set the mode of a file

Stewart Midwinter stewart at midtoad.homelinux.org
Mon Mar 1 14:58:27 EST 2004


If you were wanting to do it from within your Python program, you could use the
os.system() command.  If you want to check if the mode change was successful,
you could monitor the return code from that command, by using os.popen2 or
popen4, or even the new popen5 command. 

cheers

-- 
Stewart Midwinter
Calgary, Alberta
stewart 'at' midwinter 'dot' ca


Quoting hcohen2 <hcohen2 at comcast.net>:

> Kirk Bailey wrote:
> 
> > I want to set the mode of a text file to 666. How do I do it?
> >
> Assuming Linux/UNIX
> 
> $ chmod 666 <file name>   /* Means read write for file owner, group, 
> public [i.e. any user] is that what you really want? */
> 
> Explanation: 4 - read, 2 - write and 1 - executable, I usually make mine 
> 755 on this one user machine.
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 




More information about the Tutor mailing list