• C

Spawning program does not complete correctly

I've written an DOS application in MSVC 1.52.
It executes PKZIP and PKUNZIP a number of times.  But one  call always appears to hang.  I've executed the command directly from the command line rather than from my application and it works correctly.  I'm using _spawnl( _P_WAIT, ...) and checking for any error returned from the call.

Could it be a memory allocation problem? complier/linker setting? or does anyone have any idea how to solve this problem.

Thanks in advance,

Gary
garywilkinsonAsked:
Who is Participating?
 
rbrCommented:
Can you post some piece of your code pls!
0
 
alexoCommented:
>> Could it be a memory allocation problem?
Possibly.  DOS has a limited memory pool and both your program and PKZIP must fit in free memoty.

>> does anyone have any idea how to solve this problem.
Try fiddling with PKZIP "troubleshooting" options:

    -3     Disable 32-bit instruction usage on 80386 or higher CPU's
    -^      Echo the command line
    -+     Disable Expanded Memory (EMS) usage
    --      Disable UMB/HMA Memory (XMS) usage
    -~     Disable Network usage
    -)      Disable 32 bit DPMI usage
    -(      Use "Slow" MemCopy

0
 
AlexVirochovskyCommented:
I think, that is memory problem . After some time working of
programm in memory are "leeps" and no large size of free
memory for pkzip. Solution: close all files, make free all
dinamic alloc of memory, make pkzip/pkunzip , open all
files ...
Regards, Alex
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
Darren_SimonsCommented:
I wonder if this is similar to a known problem with install kits. Using eg. InstallShield, if you want to execute another install program you often do not get control back at the end of the called program's execution - ISTR a workaround for that on the InstallShield website (support.installshield.com). You might be able to tailor that to your problem.

Darren

0
 
MithanderCommented:
I'm not sure what the '_spawnl( _P_WAIT, ...)' command does.  But the thing that first comes to mind is that it waits for an error it never gets, so it just sits there.  I don't know though.  Maybe it will help point you in the write direction.
0
 
garywilkinsonAuthor Commented:
I have managed a work-around by creating multiple zip files and unzipping seperately rather than creating just one zip file for all my files.  I would still like to know if it is possible to create just one zip file by doing things differently.

The code I'm using is as follows:
if (_spawnl( _P_WAIT, "D:\\PKUNZIP.EXE", "PKUNZIP", "-o", "D:\\JDWE441A.ZIP", "D:\\", NULL) < 0)

0
 
AlexVirochovskyCommented:
You can tray use batch file and use "exec" command.
You batch file may be static(with you system) or
dinamic: create , use, delete
0
 
garywilkinsonAuthor Commented:
I have managed a work-around by creating multiple zip files and unzipping seperately rather than creating just one zip file for all my files.  I would still like to know if it is possible to create just one zip file by doing things differently.

The code I'm using is as follows:
if (_spawnl( _P_WAIT, "D:\\PKUNZIP.EXE", "PKUNZIP", "-o", "D:\\JDWE441A.ZIP", "D:\\", NULL) < 0)

0
 
garywilkinsonAuthor Commented:
I have managed a work-around by creating multiple zip files and unzipping seperately rather than creating just one zip file for all my files.  I would still like to know if it is possible to create just one zip file by doing things differently.

The code I'm using is as follows:
if (_spawnl( _P_WAIT, "D:\\PKUNZIP.EXE", "PKUNZIP", "-o", "D:\\JDWE441A.ZIP", "D:\\", NULL) < 0)

0
 
garywilkinsonAuthor Commented:
I have managed a work-around by creating multiple zip files and unzipping seperately rather than creating just one zip file for all my files.  I would still like to know if it is possible to create just one zip file by doing things differently.

The code I'm using is as follows:
if (_spawnl( _P_WAIT, "D:\\PKUNZIP.EXE", "PKUNZIP", "-o", "D:\\JDWE441A.ZIP", "D:\\", NULL) < 0)

0
 
sergelebelCommented:
<try this>  write another program using the same calling as your existing program...but keep it as small as possible to use very little memory...this will confirm that your problem is indeed memory related..(which I think it is) .. another suggestion would be to look into another Zip program which uses less memory or upper memory..!  
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.