Version number misery
Benjamin Kosnik
bkoz@redhat.com
Thu May 17 23:12:00 GMT 2001
> Thanks to all for replying... but I need an ostream that writes
> to a pipe :/. The standard simply doesn't provide a way to link
> an open fd (returned by the pipe(2)) to an ofstream.
Listen to Gaby. It would be better to do this sensibly. I think Dietmar
might have written something like this up, but probably for FILEs: you
might want to email him, or search the web, or his homepage. It might
also be on boost.
Does sound useful though.
>From man:
pipe creates a pair of file descriptors, pointing to a
pipe inode, and places them in the array pointed to by
filedes. filedes[0] is for reading, filedes[1] is for
writing.
so filedes[0] could be linked to istream
filedes[1] to ostream
...
filebuf(fdopen(filedes[0]..), ios_base::in)
...
etc.
Could be interesting, I'd be interested in hearing what you come up with.
-benjamin
More information about the Libstdc++
mailing list