I have noticed that Stdio.FakeFile tends to use the error() function a lot. This isn't necessarily bad, but when it throws an error instead of just quietly accepting things like Stdio.File does, it may become a problem.
For example, closing a Stdio.File object multiple times does not cause an error. close() just returns 1 each time since the result is that the file is/remains closed. Stdio.FakeFile on the other hand, throws an error if a closed file is closed again.
Too me this seems very inconsistent. I don't know if it's Stdio.File or Stdio.FakeFile that has the "wrong" semantics, but I'm willing to bet that it's not Stdio.File... Since Stdio.FakeFile sais it's supposed to mimic a Stdio.File object, I suggest we wipe out these inconsistencies by changing Stdio.FakeFile.
Before I start doing this, are there any known things that depend on errors being thrown from Stdio.FakeFile?
pike-devel@lists.lysator.liu.se