In the Gaviota TBs API I just released, the number of files that can be opened at the same time is 4. The reason I chose that low number is because the C standard guarantees 8, but that includes stdin, stdout, stderr, and I reserved one just in case the engine is using a log file. However, this is a ridiculous low number and not realistic. It was in my to-do list to polish this part of the APIs trying to make this part dependent on what the system can tolerate. To my surprise, I see that the standard FOPEN_MAX gives the number 16 in Linux (both GCC and ICC). That is better than 8 and it will allow me to use 12 files open at the same time [1] , but... Linux can use thousands of files open at the same time (not Windows!). Why is this ridiculous low number? should I pay attention to it?
Miguel
[1] probably enough for performance.
File open at the same time
Moderator: Ras
-
michiguel
- Posts: 6401
- Joined: Thu Mar 09, 2006 8:30 pm
- Location: Chicago, Illinois, USA
-
Aaron Becker
- Posts: 292
- Joined: Tue Jul 07, 2009 4:56 am
Re: File open at the same time
The actual max open files per process is set by the system, 16 is just the lowest possible maximum. In practice, most linux systems allow unlimited simultaneous open files. To find the actual max for your process, you can call getrlimit(). To set the limit you can use ulimit.