I can get a program compiled with Turbo Pascal to use the existing stderr handle for output like this:

PROGRAM Meta2(Input, Output, Error);
..
  Assign(Error, '');
  Rewrite(Error);
  TextRec(Error).Handle:= 2;

or in the case of Delphi:

program Meta2;
..
  Assign(Error, '');
  Rewrite(Error);
  TTextRec(Error).Handle:= GetStdHandle(STD_ERROR_HANDLE);

Is there a correct and portable way to do this using FPC?

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to