Date: Wed, 21 Jan 1998 15:45:34 +0200 (IST) From: Eli Zaretskii To: Daniel Taupin cc: DJGPP List Subject: Re: Strangr diag with cat.exe In-Reply-To: <34C3922B.BDDBBD5D@lps.u-psud.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Mon, 19 Jan 1998, Daniel Taupin wrote: > c:\c\bin\cat.exe: cannot open > > Of course it does not say what it cannot open. Yes, it does: it cannot open the executable file `cat.exe'. This message comes from the DJGPP stub (that short 2KB DOS program which gets control first when every DJGPP program is invoked). The stub needs to open the executable so it could read the information about the code, data, bss etc. sections from the COFF header and then load the COFF image and set up memory before it jumps to the startup code. The usual reason for this message is a shortage of file handles. If this happens on plain DOS (no Windows), edit your CONFIG.SYS, enlarge the FILES= parameter and reboot. Windows lets you enlarge the number of files open simultaneously by using the PerVMFiles= entry in the [386Enh] section of SYSTEM.INI (at least Windows 3.X does, I don't know if so does Windows 95). You must also be aware that DOS only passes the first 20 handles to child programs. So if the Perl script that you run opens more than 17 files and *then* tries to call `cat' without closing any of the files it has open, the stub of `cat' will not be able to open its executable and read the COFF header, and you get the above message. This latter problem with child programs will be solved in DJGPP v2.02.