[GRASSGUI] Re: [grass-addons] r343 - trunk/grassaddons/gui
Michael Barton
michael.barton at asu.edu
Tue Mar 27 16:59:28 EDT 2007
Aha! A further clarification. Is octal base 8? (Pardon my novicity, but I
don't use this much).
Michael
On 3/27/07 1:34 PM, "Glynn Clements" <glynn at gclements.plus.com> wrote:
>
> Michael Barton wrote:
>
>>>> Modified:
>>>> trunk/grassaddons/gui/gis_set.py
>>>> Log:
>>>> Fixed bug with new mapset not copying WIND file from PERMANENT.
>>>>
>>>> ****Please check to see if permissions need to be set (I just copied
>>>> the WIND file permissions). Line 674 has a chmod statement, but I don't
>>>> know what to set it to (needs set of numbers for u+rw,go+r I think).
>>>
>>> 644 should mean: "u+rw, go+r"
>>>
>>> hope, it helps
>>
>> I just tried this. Seemed like a good idea but didn't work. I got an error
>> saying that I didn't have the right permissions to use the mapset.
>>
>> Maybe Daniel understands how os.chmod works
>
> The documentation at:
>
> http://docs.python.org/lib/os-file-dir.html
>
> says:
>
> chmod(path, mode)
>
> Change the mode of path to the numeric mode. mode may take one of
> the following values (as defined in the stat module) or bitwise
> or-ed combinations of them:
>
> * S_ISUID
> * S_ISGID
> * S_ENFMT
> * S_ISVTX
> * S_IREAD
> * S_IWRITE
> * S_IEXEC
> * S_IRWXU
> * S_IRUSR
> * S_IWUSR
> * S_IXUSR
> * S_IRWXG
> * S_IRGRP
> * S_IWGRP
> * S_IXGRP
> * S_IRWXO
> * S_IROTH
> * S_IWOTH
> * S_IXOTH
>
> The stat.py file gives these constants their usual numeric values. If
> you want to use a numeric value in the os.chmod() call, you will need
> to specify it in octal (with a leading zero), e.g.:
>
> os.chmod(os.path.join(database,location,mapset,'WIND'), 0644)
>
> Note: 644 (decimal) = 01204 (octal) = t-w----r-- (u=w,g=,o=r,t), which
> isn't much use (the owner can't read it).
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University
phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton
More information about the grass-gui
mailing list