Re: Get file name from file handle

2009-02-17 Thread bieffe62
On Feb 17, 9:21 am, loial 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 d

Re: Get file name from file handle

2009-02-17 Thread Duncan Booth
loial wrote: > Is there anyway, having been passed a file handle, to get the > filename? > > I am assuming not, but thought I would ask > > If you mean a Python file object then file.name (but it may not exist on all file objects). If you mean a system file handle, then which filename would

Re: Get file name from file handle

2009-02-17 Thread Noprianto
On 2/17/09, loial wrote: > > Is there anyway, having been passed a file handle, to get the > filename? > > I am assuming not, but thought I would ask >>> a = open('/etc/passwd') >>> a.name '/etc/passwd' >>> Best regards, Nop -- http://mail.python.org/mailman/listinfo/python-list

Get file name from file handle

2009-02-17 Thread loial
Is there anyway, having been passed a file handle, to get the filename? I am assuming not, but thought I would ask -- http://mail.python.org/mailman/listinfo/python-list