Solved

Not enough file handles under nt for a dos program

Posted on 1998-10-12
6
314 Views
Last Modified: 2008-03-10
We have a native DOS program that runs fine under win95.  We also routinely have > 15 files open at once.  Under win95 we just stick FILES=100 in the config.sys along with a watcom 11 run-time library call to _grow_handles(128) and everything works just wonderful.  Under NT I haven't found the equivilant of FILES=100 and the program quickly runs out of file handles.  Aside from porting the program to win32 what can I do?
0
Comment
Question by:clwells082798
6 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 1253488
As the program runs under the 16bit subsystem ob NT, have you tried checking the option 'Run in separate address space' in the settings for this particular DOS app?
0
 
LVL 1

Expert Comment

by:NakedTimeMan
ID: 1253490
Hi clwells,

I think you are misdiagnosing the problem...  The default number of handles that you can have under a dos window is 256.  If you are opening more than 255 files at the same time... that's another problem, but if you are not (and I'm guessing you are not) you should be fine.

I've actually tryed this out,  I wrote a 15 line program that just opens a bunch of file handles and never closes them in a while(1) loop.  Every iteration I print out the handle and the counter, and it never fails to open any of them until it tries to open file number 256.

Hope this helps you look into the right direction.

P.S.
By the way are you running the program under COMMAND or CMD? they both appear to be the same shell, but in fact they are NOT.   I personally like CMD much better than command, but I guess it depends on what you want to use it for.

Regards
NakedTimeMan

0
 

Author Comment

by:clwells082798
ID: 1253491
well I used conklin's and jkr's comments to fix the problem before nakedtimeman ever posted so I am rejecting nakedtimeman's answer and conklin or jkr should post an answer so I can given them credit.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:clwells082798
ID: 1253493
Never tried "run in different address space" so you get it.
0
 
LVL 86

Expert Comment

by:jkr
ID: 1253494
Well, seems that i've been too slow ;-)
0
 

Expert Comment

by:YensidMod
ID: 9302123
Points to jkr.

Yensidmod
EE Moderator
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
stack 22 172
Best UNIX-compatible free C compiler for Windows or Mac 6 255
SQL Server 2008 R2, need a pivot/cross tab query... 4 30
Loading flat file data in tables 2 42
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

820 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