Subject: Re: [boost] File Handle and FILE* wrappers?
From: Nat Goodspeed (nat_at_[hidden])
Date: 2014-12-15 18:25:44
On Wed, Nov 26, 2014 at 4:21 PM, Rob Stewart <robertstewart_at_[hidden]> wrote:
> On November 26, 2014 3:57:06 PM EST, Andrey Semashev <andrey.semashev_at_[hidden]> wrote:
>>On Wednesday 26 November 2014 20:10:31 Olaf van der Spek wrote:
>>> On Thu, Nov 20, 2014 at 9:10 AM, Olaf van der Spek <ml_at_[hidden]>
>>> > It does solve the RAII part but it doesn't provide a standard
>>> > interface for native IO.
>>> Does noone use native IO?
>>I do, from time to time. But I always found RAII wrappers sufficient
>>the native API to work with file descriptors. I usually need something
>>low-level or non-portable anyway when I do this.
> I use filesystem or IOStreams when I want portability, and otherwise use RAII and native APIs when the code isn't portable.
Interestingly, I just stumbled across a bit of live legacy code that
relies on __gnu_cxx::stdio_filebuf to allow constructing an istream or
ostream from an open FILE*. This does not port to libc++.
What surprised me was that I could find no support for FILE* in
Boost.Iostreams. Writing a streambuf isn't rocket science, but I would
think that this particular use case would be common enough to warrant
Am I overlooking something?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk