www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/09/27/19:04:51

Date: Wed, 27 Sep 1995 18:05:11 -0400
From: kagel AT quasar DOT bloomberg DOT com
To: rothweil AT mmlab DOT mml DOT mmc DOT com
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Problem: Output redirection is using up file handles.
Reply-To: kagel AT ts1 DOT bloomberg DOT com

   From: rothweil AT mmlab DOT mml DOT mmc DOT com (Joseph Rothweiler,263E,2481,4611995)
   Date: 27 Sep 1995 12:46:45 -0400
   Organization: Martin Marietta Laboratories - Baltimore

   Here's my problem: I have the following program (tst.c) that
   I compiled with djgpp v.2 patchlevel 3:

   #include <stdio.h>
   main() {printf("Test\n");}

   I then create a batch file with the line: tst >tst.out
   repeated about 100 times. After about the 55'th line, I get
   the message:
   "Warning: cannot open swap file c:\tmp\cwsdpmi.swp"
   After that, trying to run any command just gives the
   error message: "Too many open files in system (ENFILE)"
   They system must be rebooted to return to normal operation.
   I am running MS-DOS ver. 6.20, with FILES=60.

   It looks as if the program opens a file handle every time, and
   never releases is when the program exits. Just wondered if
   anyone else has run into this problem, and if so, is there
   a way around it?


Tst.c never gets to see the redirection, it is handle by DOS before starting up
the program.  It seems unlikely that the problem lies in DJGPP.  Probably DOS
has opened the 100 files for the tst.out redirections and does not close them
until the script exits.  But since you have run out of the 60 FILES specified
in config.sys the script exits abnormally and a DOS BATCH bug prevents the
files form being closed.  Try FILES=110 as a work around!

-- 
Art S. Kagel, kagel AT ts1 DOT bloomberg DOT com

Variety is the soul of pleasure.  --  Aphra Behn

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019