| delorie.com/archives/browse.cgi | search |
| Date: | Mon, 3 Jul 2000 13:15:25 +0300 (IDT) |
| From: | Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> |
| X-Sender: | eliz AT is |
| To: | Olaf van der Spek <Olaf AT XCC DOT TMFWeb DOT NL> |
| cc: | djgpp AT delorie DOT com |
| Subject: | Re: Pipe to sendmail (like Perl) |
| In-Reply-To: | <BqX75.259868$k22.1127728@flipper> |
| Message-ID: | <Pine.SUN.3.91.1000703131252.22345C-100000@is> |
| MIME-Version: | 1.0 |
| Reply-To: | djgpp AT delorie DOT com |
| Errors-To: | nobody AT delorie DOT com |
| X-Mailing-List: | djgpp AT delorie DOT com |
| X-Unsubscribes-To: | listserv AT delorie DOT com |
On Mon, 3 Jul 2000, Olaf van der Spek wrote:
> I tried this:
>
> #include <cstdio>
>
> int main()
> {
> FILE* mail = popen("/usr/sbin/sendmail", "wt");
> cout << mail << endl;
> return 0;
> }
>
> But the output is:
> (nil)
I'm not a C++ expert, but IIRC you cannot use cout in conjunction with a
FILE object. Checking whether mail is a NULL pointer might shed some
light on what's going on.
In any case, what do you expect sendmail to produce when you pass it an
empty line?
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |