16 bit vs 32 bit and rewrite and win32 api and I/O error 32

The following code works OK in 16 bit code but gives errors in 32 bit
code.
I think it has something to do with the win32 api.  
The code is running against Netscape FastTrack and errors when FastTrack
is running but is OK when FastTrack is not running.
The error is 'EInOutError I/O Error 32';
See line 13 below.

procedure TForm1.FormCreate(Sender: TObject);
 var
 cgiIniFile:TIniFile;
 outputFile:TextFile;
 outputFileName:String;
begin
 cgiIniFile:=TIniFile.Create(ParamStr(1));
 outputFileName:=cgiIniFile.ReadString('System','Output File','Not
found');
 cgiIniFile.Free;

 Try
  assignFile(outputFile,outputFileName);
  ShowMessage(ParamStr(1)+':'+outputFileName);{for testing, all works ok
at this point}
{13}  reWrite(outputFile);          {<--- this is where the error
occurs}
  {reset(outputFile); this also causes the same error}
  writeln(outputFile, 'HTTP/1.0 200 OK');

1:Does anyone know why the error occurs?
2:Does anyone have a sample program that works with Netscape to share?
3:Please help me so I do not have to code in VB.