strange interaction between open and cwd

Grant Edwards invalid at invalid.invalid
Mon May 3 13:41:42 EDT 2010


On 2010-05-03, Baz Walter <bazwal at ftml.net> wrote:

> i think what i'm asking for is a python function that, given, say, a 
> valid file descriptor, can return the file's full path.

Firstly, a file may have any number of paths (including 0).

> would such a thing even be possible?

Yes. You have to search the filesystem and compare the descirptor's
inode number to that of every file in the filesystem.  It will match 0
or more of them.

However, that will probably take a long time (many minutes) for a
typical "single partition" Unix filesystem.  If you have a dedicated
filesystem with a small number of files, it may be feasible.

-- 
Grant Edwards               grant.b.edwards        Yow! !!  I am having fun!!!
                                  at               
                              gmail.com            



More information about the Python-list mailing list