Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++
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 26-Apr-11 20:09pm
Comments
Albert Holguin at 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
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 490
1 Prakriti Goyal 302
2 Yogesh Kumar Tyagi 224
3 Maciej Los 185
4 Sergey Alexandrovich Kryukov 167
0 OriginalGriff 6,652
1 Sergey Alexandrovich Kryukov 5,449
2 Maciej Los 3,474
3 Peter Leow 3,303
4 DamithSL 2,505


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 30 Apr 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100