Why no isexec, isread, iswrite, etc (was: I must be missing something obvious: os.path.isexecutable?)

Steve Lamb grey at despair.rpglink.com
Sat Jan 20 03:49:41 EST 2001


On 19 Jan 2001 00:29:44 -0500, David Bolen <db3l at fitlinxx.com> wrote:
>One possibility is that there's more than one answer to the question
>of "isexec" - it's not a single bit, but one that can exist for all of
>owner, group and world.  Thus, for example, Perl has both -x and -X to
>deal with effective and real uid/gid, but even then the brief writeup
>I found via perldoc doesn't get very descriptive of under precisely
>what conditions they return true.  (E.g., what if it's only other
>executable - is that covered by the "effective uid/gid" of -x?)

    OK, another newbie question coming at'cha...

    I was looking at os.path.isfile, islink, isdir and wondering why there
isn't an isexec, isread, iswrite.  Then hit upon the stat macros, which is
what led to the above answer.  OK, continued on with maybe writing some
isread, iswrite, isexec to be consistant in some manner.

    Then while looking for an answer for another person's question I ran
across os.access().

    Oddly enough it works just fine even though on this install (1.5.2,
Debian) I cannot appear to find where access is defined in os.py or
posixpath.py.  

    Soooooo, right back were we started.  Wouldn't it be easier to have these
with their counterparts in os.path at the very least for consistency's sake?
Glad I found them, though.  Also, does anyone know where they are in the
libraries so I may see the code?

-- 
         Steve C. Lamb         | I'm your priest, I'm your shrink, I'm your
         ICQ: 5107343          | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------



More information about the Python-list mailing list