Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Is there any limitation in number of opened file at a same time? How many files could be open at a time? Is there any limitation related to the hard disk in writing data blocks in a file?
Posted
Comments
Albert Holguin 27-Apr-11 14:27pm    
every time you open a file, the contents are typically loaded to memory, so opening a large number of files is not recommended

Actually, this is a good question. No matter if you going to hit some limits, you should always know what limits are. In any case, he already got a useful information about C Run-time limitations. In the end, you are always interested in hard disk or memory size, and processors speed limits. Comparing NTFS and FAT you will always mention support for long names limited in FAT.
Sergey Chepurin.
 
Share this answer
 
There is a C run time limit that Vishal has mentioned above (you can set its value up to 2048). Depending on the OS, this may or may not work. If the OS's max limit per process is less than that, setting it to 2048 won't help. Simuilarly, if the OS has a higher limit, you still can't take advantage of that.

Realistically speaking, your app will most likely choke way before you hit this limit. In general try not to use up OS resources to their max limit.
 
Share this answer
 
If you're about to hit any system limitation, it is a good sign of the problem of your software design.
If you can justify opening many files, I would like to see it. It is likely that a more reasonable approach exists.

—SA
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900