Re: Ideas about enhancements to fileobjects

Tracy Tims (tracy@gold.sni.ca)
Tue, 23 Nov 1993 18:45:04 -0500

Not all Unixes tell you that a pipe is a pipe. Some tell you that a pipe
is a regular file. That's the traditional semantics of st_mode. This has
been a problem for me in the past, and I expect it will be a problem again.

And 'safe programming in python'? I'm amused.

I have considered doing a general peekable 'thing' implementation which would
be passed a 'thing' source and would allow 'thing' lookahead. I'm not sure
it would be worth the trouble, since it really needs to be in C. Also, there
is the question of passing it a method when creating the peekable object.

Steven Majewski has some good ideas along these lines.

But you realize that there is an advantage in being able to peek
the input of all kinds of code out there that people have already
written? What if I could peek a stream to decide whether I was
going to treat it as text or pass it to the existing rfc822
parser?

I think (it's a bit hard to tell) that John Redford and I have a different
idea of what a file object should be. For the record, "The map is not the
territory".

Tracy Tims
tracy@sni.ca