TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Paul Edwards
date: 1995-11-08 12:40:54
subject: watcom and warp

I used to be able to open 92 files under OS/2 2.1 with the below
program, but under OS/2 3.0 I can only get 13.  Has something
changed with regards to file handles?  The executable is
unchanged, and compiled with Watcom.  BFN.  Paul.

/* Test maximum number of files that can be opened */
/* Written by Paul Edwards and released to the public domain */

#include 

int main(void)
{
    int x;
    char fnm[FILENAME_MAX];
    FILE *fq;

    printf("ISO guarantees at least %d\n", FOPEN_MAX - 3);    
    for (x=0; x< 200; x++)
    {
        sprintf(fnm, "maxxx.%d", x);
        fq = fopen(fnm, "w");
        if (fq == NULL)
        {
            printf("max is %d\n", x-1);
            return (0);
        }
    }
    printf("max is at least %d\n", x);
    return (0);
}
@EOT:

---
* Origin: X (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.