This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author christian.heimes
Recipients christian.heimes, loewis
Date 2007-10-28.18:14:43
SpamBayes Score 0.027939135
Marked as misclassified No
Message-id <4724D192.2000009@cheimes.de>
In-reply-to <1193593465.61.0.675129895248.issue1351@psf.upfronthosting.co.za>
Content
Martin v. Löwis wrote:
> I'm skeptical:
> 
> - If you add getsize, why not getlastchangeddate, getowner, getpermissions?

getowner() etc. work only with file based streams and not with memory
buffers. getsize() works with every concrete class in io.py

> - in general, streams (which really is the interface for file-like
> objects) don't have the notion of "size"; only some do.

I understand that getsize() doesn't make sense for e.g. a socket based
stream. However the implementation of getsize() works with memory
buffers and file descriptors

> - what is the purpose of the f.tell fragment? ie. why could that work
> when fstat doesn't?

The tell(), seek(0,2) is a generic fall back for io instances that
aren't based on a file descriptor. It's required for BytesIO and
StringIO. However I could come up with an implementation for BytesIO
that queries the buffer directly.
History
Date User Action Args
2007-10-28 18:14:44christian.heimessetspambayes_score: 0.0279391 -> 0.027939135
recipients: + christian.heimes, loewis
2007-10-28 18:14:43christian.heimeslinkissue1351 messages
2007-10-28 18:14:43christian.heimescreate