Topic: pipes and iostreams
Author: Alexander Terekhov <terekhov@web.de>
Date: Fri, 2 Aug 2002 16:36:27 GMT Raw View
Beman Dawes wrote:
[...]
> The proposal interface wouldn't be a C++ binding to a non-C++ API.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Pardon my poor English and ignorance... what's this?
regards,
alexander.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: bdawes@acm.org (Beman Dawes)
Date: Mon, 5 Aug 2002 02:22:59 GMT Raw View
Alexander Terekhov <terekhov@web.de> wrote in message news:<3D4AB3E9.3AE5BA6E@web.de>...
> Beman Dawes wrote:
> [...]
> > The proposal interface wouldn't be a C++ binding to a non-C++ API.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Pardon my poor English and ignorance... what's this?
Poor (or at least unclear) English on my part. The idea I was trying
to convey was that the interface would be designed using C++ idioms
such as classes, templates, and exceptions, and so would not just be a
one-to-one forwarding from function calls in the C++ library to
function calls in the non-C++ library.
--Beman
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: kanze@gabi-soft.de (James Kanze)
Date: Tue, 30 Jul 2002 15:59:24 GMT Raw View
bdawes@acm.org (Beman Dawes) wrote in message
news:<70fa0367.0207291649.1b8e146a@posting.google.com>...
> kanze@gabi-soft.de (James Kanze) wrote in message
> news:<d6651fb6.0207290826.40c5ca6f@posting.google.com>...
> > Erik Steffl <steffl@bigfoot.com> wrote in message
> > news:<3D43A6BF.C2297257@bigfoot.com>...
> > > I was wondering why there is no pipe stream in standard iostream
> > > library. Any rationale?
> > Probably because a lot of systems don't have pipes.
> For hosted systems (are they the only ones that really matter as far
> as iostreams go?) that was certainly correct in the past, but I'm
> wondering if it is still true today.
I asked myself the same question when I posted:-).
We live in the past. At least, standardization organizations tend to.
(Except C++, which sometiles lives in the future.)
It's an interesting question: shouldn't we be living a little more in
the present. Not only with regards to pipe streams, but support for
one's complement or signed magnitude, or for different sized data
pointers.
> I've been looking at some of the important IBM and other legacy
> systems, and find that they haven't been standing still over the past
> 30 years. Turns out support for the more modern POSIX features has
> been retrofitted. Meanwhile newer offerings have also tended to
> support POSIX.
> Nicolai Josuttis has a library (fdstream.hpp) in his book, with a
> current version on his web site, that he is considering proposing for
> Boost. Using it for pipes is one of the sample programs he gives.
> Works for POSIX, Windows, etc.
When I implemented a C standard library (many, many years ago), I added
the feature that if the filename passed to fopen started with a "!",
fopen opened a pipe to or from the following command. Standardize this,
and filebuf is sufficient. (On the other hand, when I needed the same
functionality in C++, I created a pipebuf, with an ipipestream and an
opipestream.)
Obviously, regardless of the implementation, what the command string
means is implementation defined. (Like system.)
--
James Kanze mailto:jkanze@caicheuvreux.com
Conseils en informatique orient e objet/
Beratung in objektorientierter Datenverarbeitung
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: Barry Margolin <barmar@genuity.net>
Date: Tue, 30 Jul 2002 18:13:46 GMT Raw View
In article <70fa0367.0207291649.1b8e146a@posting.google.com>,
Beman Dawes <bdawes@acm.org> wrote:
>kanze@gabi-soft.de (James Kanze) wrote in message
>news:<d6651fb6.0207290826.40c5ca6f@posting.google.com>...
>> Erik Steffl <steffl@bigfoot.com> wrote in message
>> news:<3D43A6BF.C2297257@bigfoot.com>...
>>
>> > I was wondering why there is no pipe stream in standard iostream
>> > library. Any rationale?
>>
>> Probably because a lot of systems don't have pipes.
>
>For hosted systems (are they the only ones that really matter as far
>as iostreams go?) that was certainly correct in the past, but I'm
>wondering if it is still true today. I've been looking at some of the
>important IBM and other legacy systems, and find that they haven't
>been standing still over the past 30 years. Turns out support for the
>more modern POSIX features has been retrofitted. Meanwhile newer
>offerings have also tended to support POSIX.
But the C and C++ specifications are in no way dependent on POSIX. In
fact, it's the other way around: the POSIX specification is written in
terms of C.
The right place for pipe streams would be in a POSIX binding for C++.
--
Barry Margolin, barmar@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: bdawes@acm.org (Beman Dawes)
Date: Fri, 2 Aug 2002 15:49:54 GMT Raw View
Barry Margolin <barmar@genuity.net> wrote in message news:<eGA19.10$jG2.965@paloalto-snr1.gtei.net>...
> In article <70fa0367.0207291649.1b8e146a@posting.google.com>,
> Beman Dawes <bdawes@acm.org> wrote:
> >kanze@gabi-soft.de (James Kanze) wrote in message
> >news:<d6651fb6.0207290826.40c5ca6f@posting.google.com>...
> >> Erik Steffl <steffl@bigfoot.com> wrote in message
> >> news:<3D43A6BF.C2297257@bigfoot.com>...
> >>
> >> > I was wondering why there is no pipe stream in standard iostream
> >> > library. Any rationale?
> >>
> >> Probably because a lot of systems don't have pipes.
> >
> >For hosted systems (are they the only ones that really matter as far
> >as iostreams go?) that was certainly correct in the past, but I'm
> >wondering if it is still true today. I've been looking at some of the
> >important IBM and other legacy systems, and find that they haven't
> >been standing still over the past 30 years. Turns out support for the
> >more modern POSIX features has been retrofitted. Meanwhile newer
> >offerings have also tended to support POSIX.
>
> But the C and C++ specifications are in no way dependent on POSIX. In
> fact, it's the other way around: the POSIX specification is written in
> terms of C.
>
> The right place for pipe streams would be in a POSIX binding for C++.
You missed my point completely; perhaps I was unclear. See if this is
more understandable:
The point is that many or even most hosted operating systems now
support features like pipes, and they tend to do so in similar ways.
Thus a proposal today might be recieved more favorably by the C++
committee than 10 years ago.
The proposal interface wouldn't be a C++ binding to a non-C++ API. It
would be something like Nico's fdstream library which in a few lines
of code adapts the C++ Standard Library's iostream interface to work
with pipes and other operating system resources.
--Beman
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: Erik Steffl <steffl@bigfoot.com>
Date: Mon, 29 Jul 2002 04:39:16 GMT Raw View
I was wondering why there is no pipe stream in standard iostream
library. Any rationale?
erik
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: kanze@gabi-soft.de (James Kanze)
Date: Mon, 29 Jul 2002 16:30:16 GMT Raw View
Erik Steffl <steffl@bigfoot.com> wrote in message
news:<3D43A6BF.C2297257@bigfoot.com>...
> I was wondering why there is no pipe stream in standard iostream
> library. Any rationale?
Probably because a lot of systems don't have pipes.
--
James Kanze mailto:jkanze@caicheuvreux.com
Conseils en informatique orient e objet/
Beratung in objektorientierter Datenverarbeitung
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: bdawes@acm.org (Beman Dawes)
Date: Tue, 30 Jul 2002 01:00:40 GMT Raw View
kanze@gabi-soft.de (James Kanze) wrote in message news:<d6651fb6.0207290826.40c5ca6f@posting.google.com>...
> Erik Steffl <steffl@bigfoot.com> wrote in message
> news:<3D43A6BF.C2297257@bigfoot.com>...
>
> > I was wondering why there is no pipe stream in standard iostream
> > library. Any rationale?
>
> Probably because a lot of systems don't have pipes.
For hosted systems (are they the only ones that really matter as far
as iostreams go?) that was certainly correct in the past, but I'm
wondering if it is still true today. I've been looking at some of the
important IBM and other legacy systems, and find that they haven't
been standing still over the past 30 years. Turns out support for the
more modern POSIX features has been retrofitted. Meanwhile newer
offerings have also tended to support POSIX.
Nicolai Josuttis has a library (fdstream.hpp) in his book, with a
current version on his web site, that he is considering proposing for
Boost. Using it for pipes is one of the sample programs he gives.
Works for POSIX, Windows, etc.
--Beman
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]