Article View: be.comp.programming
Article #16114Re: piping in c++ (Linux)
From: Thunderbird
Date: Mon, 26 Jun 2000 00:00
Date: Mon, 26 Jun 2000 00:00
31 lines
1591 bytes
1591 bytes
Ok, bedankt, werkt perfect hier, maar nu vraag ik mij af hoe ik de output van
de functie system() in die mail kan stoppen. grep<< system(commando-oproep)
werkt niet.
De regels die ik krijg via system ("grep stringske uit_deze_file") komen
gewoon op mijn scherm, maar dus niet in mijn mail.
Alvast bedankt,
T-bird
Wim Dumon wrote:
>
> #include <stdio.h>
> #include <stdiostream.h>
>
> int main()
> {
> FILE *foo = popen("/bin/grep zeepbel", "w");
> ostdiostream grep(foo);
> grep << "a b c 1 2 3" << endl;
> grep << "Een geexplodeerde zeepbel" << endl;
> grep << "hopsasa tralala" << endl;
> }
>
> Ik ben wel niet zeker dat stdiostream een standaard class is. Werkt in
> elk geval op gcc 2.95.2. In het andere geval kan je nog altijd de
> standaard C calls gebruiken (fprintf())
>
> Groetjes,
> Wim.
Technical Details
Message-ID:
<39575A47.859C4E1A@pandora.be>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<39571EF3.521B9432@pandora.be> <39573F15.68D19DC6@easics.be>Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit X-Google-Thread: fcea4,d6eda102769bf952 X-Google-Attributes: gidfcea4,public From: Thunderbird <thunderbirds@pandora.be> Subject: Re: piping in c++ (Linux) Date: 2000/06/26 Message-ID: <39575A47.859C4E1A@pandora.be> X-Deja-AN: 639109417 Content-Transfer-Encoding: 7bit References: <39571EF3.521B9432@pandora.be> <39573F15.68D19DC6@easics.be> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@pandora.be X-Trace: afrodite.telenet-ops.be 962026035 212.123.13.132 (Mon, 26 Jun 2000 15:27:15 MET DST) Organization: Pandora-- Met vlotte tred op Internet MIME-Version: 1.0 NNTP-Posting-Date: Mon, 26 Jun 2000 15:27:15 MET DST Newsgroups: be.comp.programming