delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/07/09/15:15:37

From: "Olaf van der Spek" <Olaf AT XCC DOT TMFWeb DOT NL>
Newsgroups: comp.os.msdos.djgpp
Subject: Pipe to sendmail (again)
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
Message-ID: <yG3a5.322335$k22.1427482@flipper>
Date: Sun, 09 Jul 2000 18:40:30 GMT
NNTP-Posting-Host: 213.46.21.6
X-Complaints-To: abuse AT chello DOT nl
X-Trace: flipper 963168030 213.46.21.6 (Sun, 09 Jul 2000 20:40:30 MET DST)
NNTP-Posting-Date: Sun, 09 Jul 2000 20:40:30 MET DST
Organization: Chello Broadband
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi,

I tried the following code with g++ on a Unix Apache server.
#include <cstdio>
#include <cstdlib>
#include <iostream>

int main()
{
 FILE* mail = popen("/usr/sbin/sendmail", "tw");
 cout // << errno << endl
  << mail << endl;
 return 0;
}

The errno is commented because g++ complained about an undeclared
identifier.
I get NULL as result, meaning the pipe couldn't get opened.
When I use system("/usr/sbin/sendmail"); it starts fine, meaning that it's
accessible.


--

Olaf van der Spek
Almere, Holland
Olaf AT XCC DOT TMFWeb DOT NL
http://xcc.tiberian.com/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019