> On 29 Jun 2017, at 16:07, J��r��mie Regnault <jeremie.regnault@outlook.com> wrote:
>
> Hi,
>
> I am writing tests with streams, and I noticed that a stream opened on a
> string doesn't close, but FileStreams do close. Is it normal ?
How do you mean that ? That FileStreams close automatically ?
That is indeed the case, that they are closed as a finalization action (i.e. when they become garbage), but that I consider that a fail safe thing, not something you should rely on. They should be properly closed, like #readStreamDo: and #writeStreamDo: do.
Streams over collections such as Strings do not need closing, as there is no opening either. But general stream code better does.
> --
> J��r��mie Regnault
>
|
������ | Guille Polito Research Engineer French National Center for Scientific Research - http://www.cnrs.fr Phone: +33 06 52 70 66 13 |