In our previous episode, Marc Santhoff said:
> 
> I'm trying to get unix.popen() running. The RTL.pdf says the file opened
> with popen (stdin for reading here) has to be reset or rewritten. The
> example does not do anything like that.

Apparantly that is false;

uses unix;

var
  f: text;
  s: ansistring;
begin
  s := '';
  popen(f, '/usr/bin/w', 'r');
//  reset(f);
  while not eof(f) do
  begin
    readln(f, s);
    writeln(s);
  end;
  close(f);
end.

works fine. Please file a bug against the documentation.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to