OT: unix newbie questions

Maric Michaud maric at aristote.info
Tue Jun 6 03:11:28 EDT 2006


Le Mardi 06 Juin 2006 08:36, Fredrik Lundh a écrit :
> > *26. You observed that some of your group members are fiddling with your
> > file  "myfile" and you wanted to remove the read permission to your
> > group. How do you do? (1)
>
>  >>> os.chmod("myfile.txt", 0404)

rather,
>>> os.chmod("myfile.txt", 0400)
I guess.

or maybe you want something like this :

import os, stat
os.chmod("myfile.txt", os.stat("myfile.txt").st_mode - stat.S_IRGRP)


-- 
_____________

Maric Michaud
_____________

Aristote - www.aristote.info
3 place des tapis
69004 Lyon
Tel: +33 426 880 097



More information about the Python-list mailing list