fopen / OPEN_MAX

K

Kushal Agarwal

Hello,

I need to use fopen to open a whole bunch of files, however I
discovered that I am limited in the number of simultaneous file
handles that can be opened by the constant OPEN_MAX. I tried to
modify this constant, but it appears to be compile time set, therefore
my changes are not reflected. I was wonder if anyone knew how I can
modify this constant?

Additionally, does anyone also know what other functions/procedures
may utilize the constant OPEN_MAX?

I do realize that there are other ways to open files, but for the
project I am working on it is most practical to use fopen.

Thanks,

Kushal
 
A

Artie Gold

Kushal said:
Hello,

I need to use fopen to open a whole bunch of files, however I
discovered that I am limited in the number of simultaneous file
handles that can be opened by the constant OPEN_MAX. I tried to
modify this constant, but it appears to be compile time set, therefore
my changes are not reflected. I was wonder if anyone knew how I can
modify this constant?

Additionally, does anyone also know what other functions/procedures
may utilize the constant OPEN_MAX?

I do realize that there are other ways to open files, but for the
project I am working on it is most practical to use fopen.

Thanks,

Kushal

Tnis is an implementation/system issue, not a language issue.
Posting to a newsgroup that concerns itself with your platform would be
more fruitful (hint: it's likely there's nothing you can do about this
from user space).

HTH,
--ag
 
G

Greg Comeau

I need to use fopen to open a whole bunch of files, however I
discovered that I am limited in the number of simultaneous file
handles that can be opened by the constant OPEN_MAX. I tried to
modify this constant, but it appears to be compile time set, therefore
my changes are not reflected. I was wonder if anyone knew how I can
modify this constant?

Additionally, does anyone also know what other functions/procedures
may utilize the constant OPEN_MAX?

I do realize that there are other ways to open files, but for the
project I am working on it is most practical to use fopen.

Dunno what OPEN_MAX is, but whatever the constant is,
you may be stuck, since it may be constrained by things
like the OS won't let have a process have any more open
files than that value. I've been on systems where that
value was smaller than the per process value, and
could be changed if you had the source to the C compiler's
runtime library. I know this may be easier say that one,
but you may want to see if some of the files can be closed,
or combined, put in shared memory, etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top