Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1277 (closed defect: wontfix)

Opened 11 years ago

Last modified 11 years ago

Buffers don't flush when closed

Reported by: Deewiant Assigned to: kris
Priority: critical Milestone: 0.99.8
Component: IO Version: trunk
Keywords: Cc:

Description

Buffers don't flush themselves when closed, which means that only closing a Buffer may lead to data loss. I doubt this is intentional, hence this ticket.

It seems as though something was forgotten between r2542 and r2667: Buffer.close was removed in the former, where it did flush, and brought back in the latter, after which it has not flushed.

Change History

09/01/08 21:12:27 changed by kris

  • status changed from new to closed.
  • resolution set to wontfix.

like a file or socket, it's reasonable to intentionally close a buffer without flushing it. You do have a good point, but we decided to make buffer behave like other conduits. Some of the higher-level constructs, such as Console, do flush before closing ... but that's more of an explicit action.

09/02/08 10:00:40 changed by Deewiant

Okay. I think IBuffer.close could then use some documentation saying that it doesn't flush.

And while you're at it, Conduit.close as well.