Solved

Spawning program does not complete correctly

Posted on 1998-11-09
11
194 Views
Last Modified: 2010-04-15
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
0
Comment
Question by:garywilkinson
11 Comments
 
LVL 11

Expert Comment

by:alexo
ID: 1254105
>> 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
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1254106
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
 
LVL 1

Expert Comment

by:Darren_Simons
ID: 1254107
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
 

Expert Comment

by:Mithander
ID: 1254108
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
 
LVL 10

Accepted Solution

by:
rbr earned 100 total points
ID: 1254109
Can you post some piece of your code pls!
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:garywilkinson
ID: 1254110
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
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1254111
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
 

Author Comment

by:garywilkinson
ID: 1254112
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
 

Author Comment

by:garywilkinson
ID: 1254113
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
 

Author Comment

by:garywilkinson
ID: 1254114
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
 
LVL 1

Expert Comment

by:sergelebel
ID: 1254115
<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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
port mapped I/o query 10 139
memory leak detection 9 53
Getting CURL to work with Visual Studio and C 16 389
how to understand recursion 12 206
Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now