strange interaction between open and cwd

Grant Edwards invalid at invalid.invalid
Mon May 3 22:19:04 EDT 2010


On 2010-05-03, Baz Walter <bazwal at ftml.net> wrote:
> On 03/05/10 19:12, Grant Edwards wrote:

>>> i think they should always either both succeed, or both fail.
>>
>> That's not how Unix filesystems work.
>>
>> Are you saying that Python should add code to it's open() builtin
>> which calls realpath() and then refuses to open files for which
>> realpath() fails?
>
> my original question was really about *how* python does the
> "seemingly impossible". i had hoped there might be a way to augment
> realpath so that it would always work for any path which is openable.
> but apparently that is not possible for unix filesystems.

Exactly

>> Even though the user provided a legal and openable path?
>
> that sounds like an operational definition to me: what's the
> difference between "legal" and "openable"?

Legal as in meets the syntactic requirements for a path (not sure if
there really are any requirements other than it being a
null-terminated string).  Openable meaning that it denotes a path file
that exists and for which the caller has read permissions on the file
and execute premissions on the directories within the path.

-- 
Grant




More information about the Python-list mailing list