Re: Checking File permissions

2006-07-21 Thread Tal Einat
Anoop wrote: > Hi All > > Please tell me how to check the existence of a file and the read > permission to the file using python script > > Thanks for ur inputs > > Anoop os.access(path, mode) does just this, check it out. Cross-platform-ness isn't a problem, the docs say it is available for Win

Re: Checking File permissions

2006-07-20 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Anoop wrote: > Please tell me how to check the existence of a file and the read > permission to the file using python script Without knowing what your precise needs are, the best way is to open the file and try to read from it. If that succeeds, then you've got rea

Re: Checking File permissions

2006-07-20 Thread Larry Bates
Note: You really don't have to post the same question 3 times (2 in response to yourself). import os if os.path.exists(pathname): To see if a file is writeable: import stat def iswriteable(path): mode=os.stat(path)[stat.ST_mode] return bool(stat.S_IMODE(mode) & stat.S_IWRITE) Larr

Re: Checking File permissions

2006-07-20 Thread Avell Diroll
Anoop wrote: > Please tell me how to check the existence of a file and the read > permission to the file using python script You can check the os module (os.stat comes to mind). For an exemple you can have a look at : http://www.pixelbeat.org/talks/python/ls.py Regards, Avell -- http://mail.py

Checking File permissions

2006-07-20 Thread Anoop
Hi All Please tell me how to check the existence of a file and the read permission to the file using python script Thanks for ur inputs Anoop -- http://mail.python.org/mailman/listinfo/python-list

Checking File permissions

2006-07-20 Thread Anoop
Hi All Please tell me how to check the existence of a file and the read permission to the file using python script Thanks for ur inputs Anoop -- http://mail.python.org/mailman/listinfo/python-list

Checking File permissions

2006-07-20 Thread Anoop
Hi All Please tell me how to check the existence of a file and the read permission to the file using python script Thanks for ur inputs Anoop -- http://mail.python.org/mailman/listinfo/python-list