🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #1140

Re: using "system" in C

#1140
From: Yves Forget
Date: Fri, 05 Apr 1991 02:52
35 lines
1993 bytes
In article <jono.670739550@dec06> jono@dec06.cs.monash.edu.au (Jonathan Oliver) writes:
>I am writing a rather large program (about 550K) in C and I recently
>noticed that when I called "system" in the following way
>
>	system("copy file1 file2");
>
>there was not enough memory to perform the copy.
>Is there a way of copying files that doesn't require as much memory.

If your program is so big, you may want to compile with size 
optimization (I know you can do that with Turbo C, but I didn't use it
too much, and I can't tell you how efficient it is).

Another way would be to have your program to copy the files, or,
depending on the context, you may want to generate a batch file that
will do the copy.

I think the better way is to use overlays.  If you have problems with
the system function (although you must know that the function loads a
(second) copy of command.com in memory), you may have problems generating
your code soon.  So you may have to think about overlays, or maybe buying
more memory...

Hope this helps

Yves

=======================================================================
Yves Forget                    forget at terre.dmi.usherb.ca (Internet)
Universite de Sherbrooke       bo05   at udesvm.bitnet (bitnet address)
-- 
=======================================================================
Yves Forget                    forget at terre.dmi.usherb.ca (Internet)
Universite de Sherbrooke       bo05   at udesvm.bitnet (bitnet address)
Technical Details
Message-ID: <1991Apr5.025231.20026@DMI.USherb.CA>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ganymede!pluton!forget
References: <jono.670739550@dec06>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ganymede!pluton!forget
From: forget@pluton (Yves Forget)
Newsgroups: comp.sys.ibm.pc.programmer
Subject: Re: using "system" in C
Message-ID: <1991Apr5.025231.20026@DMI.USherb.CA>
Date: 5 Apr 91 02:52:31 GMT
References: <jono.670739550@dec06>
Sender: usenet@DMI.USherb.CA (Pour Courrier usenet)
Distribution: comp
Organization: Universite de Sherbrooke
Lines: 35
Nntp-Posting-Host: pluton.dmi.usherb.ca