FAQ
I've got my first python utility working pretty good, but
I just need help on one point.

I need to test a filename and return true or false based on
whether the file is readable and writable by the user running
my utility. Oh, yes, this is on Linux:)
I'm used to writing things like, 'if [ -w $filename ]' in bash.

I think I should use os.stat() somehow, but it seems like a lot
of code would be required to check the appropriate field (user,
group, or others) based on the ownership of the file and the
uid of the user.

This seems like such a common thing. Is there a pre-written function
to handle it?

Thanks in advance,
Tipton

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 4 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedApr 3, '03 at 6:18p
activeApr 4, '03 at 4:47p
posts4
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase