[Cuis-dev] FileMan and FileStream?
juan at jvuletich.org
Fri Dec 18 22:15:10 CST 2015
On 18/12/2015 09:16 p.m., Phil (list) via Cuis-dev wrote:
> One thing I've been scratching my head over is how we should be using
> FileStreams with files now that things have moved over to FileMan. I
> see things like privateReadStream and they're used all over the image
> but if they're really all private*, should they be? I.e. should they
> be renamed or is there some sort of public stream API for them in the
As Ken has already pointed out, the public methods in 'accessing-stream'
ensure the file is closed. This is the way to make client code forget
about the differences between FileStreams (that need to be closing, even
in the case of execution errors) and other kinds of Streams (that do not
need closing). This is why it is the recommended API. There are 62
senders of these in the base image.
There are still a few places where client code knows that it is dealing
with a FileStream, the stream creation and closing are done in far away
places (ugly style), and closing is not ensured in case of execution
errors (brittle code). These are the 9 senders of the private API
outside FileMan itself. They should (and eventually will) be fixed.
More information about the Cuis-dev