473,385 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

fopen / OPEN_MAX

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
Jul 22 '05 #1
2 2535
Kushal Agarwal wrote:
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

--
Artie Gold -- Austin, Texas

20050120->44
Jul 22 '05 #2
In article <e9**************************@posting.google.com >,
Kushal Agarwal <ku************@gmail.com> wrote:
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.
--
Greg Comeau / Comeau C++ 4.3.3, for C++03 core language support
Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout
World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ming | last post by:
When I use fopen on the URL: fopen("http://home.pchome.com.tw/world/qoo4ko/110.jpg";, "r") I would get the following error message: -----------Error Message------------ Warning: fopen():...
11
by: typingcat | last post by:
Is it possible to read another web page in PHP? If is ASP.NET, the code would be ------------ WebRequest req=WebRequest.Create("http://www.microsoft.com"); WebResponse res=req.GetResponse();...
7
by: git_cs | last post by:
Hey, guys and gals Somedays ago, I had asked for the DES algorithm in C language. Although I have written the algorthim in C myself, I am facing a peculiar problem, which I hope some of u guys and...
10
by: Grocery Clerk | last post by:
I know open() returns a file descriptor and fopen() returns a pointer to FILE. The question is, when do I use fopen() and when do I use open()? Could someone give me an example when to use one...
28
by: Sathyaish | last post by:
If fopen fails, is there a way to know why?
13
by: Blue | last post by:
Hi , Can any one please let me explain me the diffrences between "open"/ "fopen" or "read"/"fread" or "write/fwrite". I know that "open" /"read" / "write" are system calls and "fopen"...
10
by: pjlsr | last post by:
It's close to twenty years since I used the C language and at that time I was doing only floating point computational work, nothing with strings or reading files. I tried to use fopen in the...
10
by: Julia | last post by:
Hi, there, I am trying to append a binary file by using: FILE *strean; stream = fopen( "c:\temp.dat", "ba+" )); Is there a way that I can check if the file exists or not before fopen,...
25
by: subramanian100in | last post by:
Consider the following program: #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv) { if (argc != 2) { printf("Usage: <program-name<text-file>\n");
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.