Boost logo

Boost Users :

Subject: Re: [Boost-users] file_descriptor_sink vs. pclose
From: Eric MALENFANT (Eric.Malenfant_at_[hidden])
Date: 2010-05-06 09:26:35


De : Dan Stahlke
>
> I've been having difficulty using iostreams::file_descriptor_sink with
> popen in Linux. The problem is that popen() requires a matching
> pclose()
> rather than a close(). Now, file_descriptor_sink has a close_on_exit
> flag that, when set to false, supposedly prevents it from calling
> close()
> on the underlying file descriptor, but it calls close() anyway. Is
> this
> a bug in boost or am I doing it wrong? As a workaround I can call
> flush
> () on the iostream and then pclose() on the filehandle, but it seems
> like
> it would be better to actually close the iostream.
>

That looks a lot like this ticket: https://svn.boost.org/trac/boost/ticket/3517
A workaround is to explicitly call set_auto_close(false).


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net