Legalize access to file descriptors now! (So sue me.)
Theodore Papadopoulo
Theodore.Papadopoulo@sophia.inria.fr
Thu Feb 17 11:29:00 GMT 2005
On Wed, 2005-02-16 at 15:42 -0800, Jan Reimers wrote:
> Interesting read .. thank you.
>
> How about the inverse problem: making a stream (or fstream) given a file
> descriptor? This arises when creating temporary files using mkstemp().
This one is easy. It has been implemented for about a year or two....
Have a look at ext::stdio_filebuf.
This being said, I have always been in favor of providing some way to
get the fileno or the FILE* from a stream (for memory mapping issues
among others).
Yes please "Legalize access to file descriptors now! ", make it under
some flag for gnu-extension with no guaranties if people use both the
stream and the fileno or FILE* and write everywhere that this is a
temporary measure that will disappear as soon as a better solution is
standardized...
In the meantime, thank's for the code Richard.
Theo.
More information about the Libstdc++
mailing list