[fpc-devel]Bug in AssignPipe() on Linux

Jeff Pohlmeyer yetanothergeek at yahoo.com
Fri Nov 7 14:15:13 CET 2003


Using the latest version of the compiler, and I am having a 
problem with the popen() function on Linux. 

It looks like popen() fails because AssignStream() fails, 
because AssignPipe() fails, and that's about as far as I got.
( I'm lost when it comes to the do_SysCall() stuff. )

Maybe whoever broke it will understand better what is wrong ;-)

[EXAMPLE]

program pipetest;

uses errors, {$IFDEF VER1_0} linux {$ELSE} unix {$ENDIF};

var 
  pipi, pipo: text;
  s: string;

begin
  writeln ('assigning pipes.');
  if not assignpipe(pipi,pipo) then 
  begin
    perror('assignpipe',linuxerror);
    halt(1);
  end;
  writeln ('writing to pipe, and flushing.');
  writeln (pipo,'this is a textstring');
  close(pipo);
  writeln ('reading from pipe.');
  while not eof(pipi) do
  begin
    readln (pipi,s);
   writeln ('read from pipe : ',s);
  end;
  close (pipi);
  writeln ('closed pipes.');
  writeln;
end.

[/EXAMPLE]

I tried this with four different compiler versions -
 - here are the results:

WORKS:  version 1.0.10 [2003/06/26] for i386  (pre-built binary)

WORKS:  version 1.1    [2003/10/11] for i386  (CVS)

FAILS:  version 1.9.0  [2003/11/05] for i386  (pre-built binary)

FAILS:  version 1.9.1  [2003/11/07] for i386  (CVS)



__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree




More information about the fpc-devel mailing list