On Friday, October 14, 2016 at 10:44:47 PM UTC, Páll Haraldsson wrote:
>
> On Friday, October 14, 2016 at 5:17:45 PM UTC, Diego Javier Zea wrote:
>>
>> Hi!
>> I have a function that uses `IOBuffer` for this creating one `String` 
>> like the example. 
>> Is it needed or recommended `close` the IOBuffer after `takebuf_string`?
>>
>
> I find it unlikely.
>
>  help?> takebuf_string
> search: takebuf_string
>
>   takebuf_string(b::IOBuffer)
>
>   Obtain the contents of an IOBuffer as a string, without copying. 
> Afterwards, the IOBuffer is reset to its initial state.
>
> reset means they take action, and could have closed if needed; IOBuffer is 
> an in-memory thing, even if freeing memory was the issue, then garbage 
> collection should take care of that.
>

Note, IOBuffer (in RAM) is not like a file in non-volatile memory (unlike 
RAM).
 

>
>
> Since this thread was necromanced:
>
> @Karpinski: "The takebuf_string function really needs a new name."
>
> I do not see clearly that that has happened, shouldn't 
>
> help?> takebuf_string
>
> show then?
>
> What would be a good name? Changing and/or documenting the above could be 
> an "up-for-grabs" issue.
>

@Steven: "Further, in this case, the "takebuf_string" function (or 
takebuf_array) isn't just conversion, it is mutation because it empties the 
buffer.  So, arguably it should follow the Julia convention and append a ! 
to the name."



> New function would just call the old function..
>
>

Reply via email to