Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote:
>  In message <[EMAIL PROTECTED]>, Michael
>  J. Fromberger wrote:
> 
> > ... since os.fdopen() only has access to the file descriptor, it
> > does not have a convenient way to obtain the file's name.
> 
>  You can do this under Linux as follows:
> 
>      os.readlink("/proc/%d/fd/%d" % (os.getpid(), fileno))

A good idea!  You can write this slightly more succinctly as

  os.readlink("/proc/self/fd/%d" % fileno)

-- 
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to