How to increase the limit on File Descriptors opened per process?  
Author Message
Qasim Ali





PostPosted: Visual C++ General, How to increase the limit on File Descriptors opened per process? Top

Hello all,

How do i increase the limit imposed by the OS on file descriptors opened by a particular process. In fact the situation i am in requires me to open a lot of files simultaneously but i am not able to do so. The current limit is around 2048 File Descriptors. Can anyone help me in this regard.

Thank you



Visual C++13  
 
 
Mike Danes





PostPosted: Visual C++ General, How to increase the limit on File Descriptors opened per process? Top

I supposed you are talking about the file descriptors used with _open, _read, _write and _close. The 2048 limit is hardcoded in the CRT so you cannot change it. However, this is not an OS limit (at least on current NT systems like Win XP). The only limit for the number of files opened by a process (handles) is the available memory. For example I have been able to open 100,000 handles using the CreateFile API.