delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/21/08:46:42

Date: Wed, 21 Jan 1998 15:45:34 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Daniel Taupin <taupin AT lps DOT u-psud DOT fr>
cc: DJGPP List <djgpp AT delorie DOT com>
Subject: Re: Strangr diag with cat.exe
In-Reply-To: <34C3922B.BDDBBD5D@lps.u-psud.fr>
Message-ID: <Pine.SUN.3.91.980121154512.27671H-100000@is>
MIME-Version: 1.0

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.

- Raw text -


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