Re: Getting File Permissions

2006-03-07 Thread Tim Chase
> Traceback (most recent call last): > File "", line 1, in ? > NameError: name 'octal' is not defined > > Since I am new to python, can any one help me to solve this error? Looks like you just want the oct() function (not "octal()") >>> [x for x in dir(__builtins__) if x.lower().find("oct") !

Re: Getting File Permissions

2006-03-07 Thread Juho Schultz
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 > > Tracebac

Re: Getting File Permissions

2006-03-07 Thread Kent Johnson
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 > > Tracebac

Getting File Permissions

2006-03-07 Thread Hari
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 "",