On Feb 17, 9:21 am, loial <jldunn2...@googlemail.com> wrote: > Is there anyway, having been passed a file handle, to get the > filename? > > I am assuming not, but thought I would ask
If by file handle you mean the object returned by 'file' and 'open' functions, it has a name attribute. If by file handle you mean the file descriptor, i.e. the integer used for low level I/O, then there is no way I know of. I believe that number is an index in an array of 'file descriptors' somewhere inside the C library ( below python interpreter level ), but I don't know if/how an user program can access it. Ciao ---- FB -- http://mail.python.org/mailman/listinfo/python-list