Connecting Tech Pros Worldwide Forums | Help | Site Map

(part 37) Han from China answers your C questions

Borked Pseudo Mailed
Guest
 
Posts: n/a
#1: Nov 21 '08
File Limit of 1021

Nick Keighley said:
Quote:
paul.lemelle@gmail.com said:
Quote:
>I am trying to create a series of 4K files, everything works fine
>until I pass the 1022 mark - I get an error stating that he file
>cannot be opened.
There is a constant in stdio.h called FOPEN_MAX. This sets a limit
on the number of files you can have open at the same time, including
stdin, stdout, and stderr. (Technically, the number of files that
you're GUARANTEED can be open at the same time. If system resources
permit, your implementation may be able to strain out some more.
Contrast this with TMP_MAX, which is an actual limit.) It would
appear that FOPEN_MAX on your system is 1024 or 1025, depending on
what you mean by "pass". Uncomment the fclose() in your program.
Quote:
getchar();
/*** njk non-standard function ***/
Having a bad day, Nicky? Blame CLC. It would make any sane mind
start seeing getch()/getche() everywhere.

Yours,
Han from China


Closed Thread