[Tutor] problem with os.chmod()

Ignacio Vazquez-Abrams ignacio@openservices.net
Wed, 12 Sep 2001 02:00:52 -0400 (EDT)


On Wed, 12 Sep 2001, lonetwin wrote:

>     I've got a problem with the os.chmod() function, it just doesn't
> seem to do the right thing, let me explain, the code given below, is
> something that I needed, I'm running this on a linux system, this code
> changes the permissions of directories and files recursively. I initially
> used os.chmod() function but it just screws up the permissions, so now I
> do a os.system() to the chmod command, but I'd like to know what is
> happening here....

The problem is that your permission values are in the wrong radix. Try using
octal instead of decimal, e.g., 0700 instead of 700.

-- 
Ignacio Vazquez-Abrams  <ignacio@openservices.net>