🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #2113

Re: MS-DOS EXEC Question

#2113
From: Marc Unangst
Date: Sat, 08 Sep 1990 23:41
27 lines
1716 bytes
west@turing.toronto.edu (Tom West) writes:
>   Does anyone know what the behaviour of the EXEC MS-DOS function is when 
> there is not enough memory to load COMMAND.COM.  
> 
> Specifically, I have a line that is:
> 
> 	retcode = spawnve(P_WAIT, "C:\COMMAND.COM", path, environ);
[computer locks up when there isn't enough mem to load COMMAND.COM]

This isn't going to help you much, but I've encountered this in
Zenith's MS-DOS v3.21 also.  Your best bet might be to check to see if
there's at least 50K left, and refuse to spawn the command processor
if there isn't.

Also, PLEASE don't hardcode "C:\COMMAND.COM" into your program.  Not
only does it prevent people who don't have a hard disk from using your
program (if you think they're rare, what about people with diskless
workstations or computers with a floppy only, who run stuff off the
network?), but it prevents people from using an alternate command
processor, such as 4DOS, with your program.  I'd suggest that you grab
COMSPEC from the environment and try to load that, and only try to
explicitly spawn COMMAND.COM if COMSPEC doesn't exist.

--
Marc Unangst               |
mju@mudos.ann-arbor.mi.us  | Angular momentum makes the world go 'round.
...!umich!leebai!mudos!mju |
Technical Details
Message-ID: <eJB8o4w163w@mudos.ann-arbor.mi.us>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!samsung!umich!ox.com!mudos!mju
References: <1990Sep7.144359.25202@jarvis.csri.toronto.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!samsung!umich!ox.com!mudos!mju
From: mju@mudos.ann-arbor.mi.us (Marc Unangst)
Newsgroups: comp.os.msdos.programmer
Subject: Re: MS-DOS EXEC Question
Message-ID: <eJB8o4w163w@mudos.ann-arbor.mi.us>
Date: 8 Sep 90 23:41:13 GMT
References: <1990Sep7.144359.25202@jarvis.csri.toronto.edu>
Organization: The Programmers' Pit Stop, Ann Arbor MI
Lines: 27