trouble with Exec command 
Author Message
 trouble with Exec command

a co-worker of mine is having troubles using the EXEC command in Turbo
Pascal 6.  He is writing an install program that will copy files from the
a drive to the c drive by doing an EXEC('copy a:*.* c:','c:\dos'); or an
equivilant.  We kept gettin dos-error 8, which is out of memory, and
tried using the $M compiler directive to allocate some more space, but it
would either lock the computer up or re-boot... is there something we are
doing wrong that keeps this from working?




Wed, 18 Jun 1902 08:00:00 GMT  
 trouble with Exec command

Quote:

>a co-worker of mine is having troubles using the EXEC command in Turbo
>Pascal 6.  He is writing an install program that will copy files from the
>a drive to the c drive by doing an EXEC('copy a:*.* c:','c:\dos'); or an
>equivilant.  We kept gettin dos-error 8, which is out of memory, and
>tried using the $M compiler directive to allocate some more space, but it
>would either lock the computer up or re-boot... is there something we are
>doing wrong that keeps this from working?


Okay try this (there might be a typing error since I just typed it in,
with out trying it)

{$M 4096, 0, 0)
Uses
  Dos,
  Crt;

BEgin
  Swapvectores
  Exec (......)
  SwapVectores
End.

Your problem is that pascal, by default, allocate ALL free base mem to
it's heap. By telling {$M 4096, 0, 0} you say :
4096 bytes stack
0    bytes minimum extra memory in heap
0    bytes maximum extra memory in heap

Now your program will be this bit in memory : ExeFileSize + 4096 (stack)
and you will susceed running the childe program...

Yours
  BUGSY/OBSESSiON



Wed, 18 Jun 1902 08:00:00 GMT  
 trouble with Exec command

Quote:

> a co-worker of mine is having troubles using the EXEC command in Turbo
> Pascal 6.  He is writing an install program that will copy files from the
> a drive to the c drive by doing an EXEC('copy a:*.* c:','c:\dos'); or an
> equivilant.  We kept gettin dos-error 8, which is out of memory, and
> tried using the $M compiler directive to allocate some more space, but it
> would either lock the computer up or re-boot... is there something we are
> doing wrong that keeps this from working?

Try this:

program test;

{$m $4096, 0, 0)

uses
  dos;

begin
  swapvectors;
  exec(getenv('comspec'), '/c copy a:\*.* c:\test');
  swapvectors;
end.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Turbo Pascal 7 Exec Command Trouble

2. Pascal Exec command in Windows XP Environment

3. exec command whit FPK Pascal

4. the exec command

5. Sending long Command lines to Exec

6. How to exec system commands

7. Help: Exec command with TPW 1.5

8. equivalant exec command in BP for BPW

9. Exec command v. Debugger

10. Exec Command problem

11. Exec file, no command.com required?

12. Exec file, no command.com required?

 

 
Powered by phpBB® Forum Software