This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Version number misery



> 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






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]