check whether directory is readable

Jonas Geiregat yux at sdf-eu.org
Tue Aug 23 09:34:27 EDT 2005


eels wrote:
> Hello,
> how can I check whether a directory is readable or not. Are there
> differences between unix and windows?

As far as I know there aren't any differences,

code:

import os
if access("/root", os.R_OK):
	print "You are able to read the /root dir"




More information about the Python-list mailing list