🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.os2.programmer
4 messages
4 total messages Started by Barry Kurtz Mon, 07 Jan 1991 21:58
Max Open File Problem
#2362
Author: Barry Kurtz
Date: Mon, 07 Jan 1991 21:58
21 lines
1374 bytes
I am having trouble porting a program to OS/2 under Microsoft C that
I've successfully ported among DOS and SCO UNIX systems.  The program
requires at least 16 files to be open at one time.  This is easily
handled on both DOS and UNIX.  The files are opened by the standard
"fopen" library function.  I find that OS/2 limits me to about 14 user
files at one time (probably a 20 file total limit).  I've investigated
the FCBS parameter in CONFIG.SYS and the DosSetMaxFH function in the
OS/2 library to no avail.  However, if I use DosSetMaxFH in conjunction
with the OS/2-specific DosOpen function I can open the desired number of
files.  Converting all fopens and fprintfs to the DOSxxx library
functions would make the program much less portable - so this is not an
acceptable answer.

Does anyone know of a way to open more than 14 user files under OS/2
using the Microsoft C 6.0 compiler?  Any help would be greatly
appreciated.


Barry Kurtz
Hewlett-Packard
Boise, Idaho
Re: Max Open File Problem
#2363
Author: Alan Ballard
Date: Wed, 09 Jan 1991 16:27
18 lines
1494 bytes
In article <6070002@hpdmd48.boi.hp.com> barry@hpdmd48.boi.hp.com (Barry Kurtz) writes:

>Does anyone know of a way to open more than 14 user files under OS/2
>using the Microsoft C 6.0 compiler?  Any help would be greatly
>appreciated.
 
You may have to reassemble the startup code.  See the file
/msc/source/startup/os2/crt0data.asm that comes with the MSC distribution.
It includes commented-out code to increase DosSetMaxFH, which you are
supposed to enable of you need more than 20. 
 
Alternatively, you might try just adding the call to DosSetMaxFH to your
program before you actually open any files.  I don't see why this wouldn't
work. 
Alan Ballard                   | Internet: ballard@ucs.ubc.ca
University Computing Services  |   Bitnet: USERAB1@UBCMTSG
University of British Columbia |    Phone: 604-228-3074
Vancouver B.C. Canada V6R 1W5  |      Fax: 604-228-5116
Re: Max Open File Problem
#2365
Author: Bob Eager
Date: Thu, 10 Jan 1991 09:43
14 lines
1231 bytes
In article <6070002@hpdmd48.boi.hp.com>, barry@hpdmd48.boi.hp.com (Barry Kurtz) writes:
> Does anyone know of a way to open more than 14 user files under OS/2
> using the Microsoft C 6.0 compiler?  Any help would be greatly
> appreciated.
> 

There is a well hidden set of files on the distribution disks that enable
you to rebuild the C runtime startup code to support a larger number of
open files. Run SETUP/COPY, and ask for the STARTUP.DOC file. That'll tell
you the names of the other files to ask for.
-------------------------+-------------------------------------------------
Bob Eager                | University of Kent at Canterbury
                         | +44 227 764000 ext 7589
-------------------------+-------------------------------------------------
Re: Max Open File Problem
#2366
Author: Barry Kurtz
Date: Thu, 10 Jan 1991 16:01
9 lines
729 bytes
Thanks for the many responses I've received here and by e-mail.  I
re-compiled and updated the libraries as per the instructions in the
SOURCE directory and things seem to work fine.  

Thanks again for your help,

Barry Kurtz
Hewlett-Packard
Boise, Idaho
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads