Hari wrote:
> Hi,
> For getting permissions of a file, the following script has been
> suggested in the same group
> 
> import os, stat
> st = os.stat(myfile)
> mode = st[stat.ST_MODE]
> print "mode is", octal(mode & 0777)
> 
> But while executing I am getting error message as follows
> 
> Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
> NameError: name 'octal' is not defined

The correct name is oct(). The docs on built-in functions are helpful here:
http://docs.python.org/lib/built-in-funcs.html

Kent
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to