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
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
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
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
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
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
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