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
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);
 outputFileName:=cgiIniFile.ReadString('System','Output File','Not

  ShowMessage(ParamStr(1)+':'+outputFileName);{for testing, all works ok
at this point}
{13}  reWrite(outputFile);          {<--- this is where the error
  {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.