Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2002-09

POpen problem

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Kochiashvili

Hello

trying run this code on FreeBSD

program sendm;
uses linux;
var
  F : text;
  i : longint;
BEGIN
  POpen( F, '/usr/sbin/sendmail -t', 'W');
  writeln( linuxerror);
  writeln( F);
  writeln( F, 'To: ');
  writeln( F, 'From: ');
  writeln( F, 'Subject: nothing');
  writeln( F);
  writeln( F, 'test');
  writeln( F);
  flush( F);
  i := PClose( F);
  writeln( i);
END.

OR
with this line

  POpen( F, '/usr/sbin/sendmail ', 'W');

and without

  writeln( F, 'To: ');

In both cases this program launches sendmail and waits for keyboard input ( as you launch it from command line). Return codes after POpen and PClose = 0. When I enter "." and <Enter>:
in first case - sendmail exits with message "No receipient addresses found in header" in second case - it sends mail to receipient with blank body, "From" and "Subject" lines

Seems that pipe don't receives input from "Writeln( F, 'any string')"

Please, any suggestions

Thank you

Michael Kochiashvili http://www.iberiapac.ge/~kochini/