This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
RE: Legalize access to file descriptors now! (So sue me.)
- From: Theodore Papadopoulo <Theodore dot Papadopoulo at sophia dot inria dot fr>
- To: Jan Reimers <janr at molienergy dot com>
- Cc: "'Richard dot Kreckel at ginac dot de'" <Richard dot Kreckel at ginac dot de>, libstdc++ at gcc dot gnu dot org
- Date: Thu, 17 Feb 2005 12:00:22 +0100
- Subject: RE: Legalize access to file descriptors now! (So sue me.)
- Organization: INRIA Sophia-Antipolis
- References: <70728FEC41F7D811813F004854506D691B0B0F@mailserv.molienergy.bc.ca>
- Reply-to: Theodore dot Papadopoulo at sophia dot inria dot fr
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.