How to use os.access()??

Malcolm Tredinnick malcolm at commsecure.com.au
Fri Jul 13 20:31:19 EDT 2001


On Fri, Jul 13, 2001 at 04:23:36PM -0700, bvdpoel at uniserve.com wrote:
> I'm trying to use os.access() in my program. But, I'm stuck trying to
> figure out the parms... obviously the first is the filename; but the 2nd
> is supposed to be a constant (?) like F_OK. Unfortunately, it doesn't
> appear that the F_OK, etc are defined anywhere. Either the docs are
> wrong (no way!), or I'm missing a module file (likely), or I'm just
> totally wrong about everything (quite likely!).

F_OK and friends are defined in the os module (since that is where they
are used). So you second parameter would be os.F_OK in this case.

Have a look at the output of dir(os) to see all the constants.

Cheers,
Malcolm

-- 
The cost of feathers has risen; even down is up!




More information about the Python-list mailing list