[Solved] Maximum number of opened files?
-
There must be a maximum number of simultaneously opened files. I found out -the hard way- by a rather strange error, that after opening 507 files, a next file could no longer be opened. After fixing the bug in my programm: closing a file after having processed the information, the error dispappeared, so 507 is close to 512, therefore i suppose that 512 files is the maximum. That assumption may be wrong. Is it possible to change the maximum number of simultaneously opened files? If so, how? 21 cm: the universal wave length of hydrogen
modified on Saturday, April 12, 2008 2:39 PM
-
There must be a maximum number of simultaneously opened files. I found out -the hard way- by a rather strange error, that after opening 507 files, a next file could no longer be opened. After fixing the bug in my programm: closing a file after having processed the information, the error dispappeared, so 507 is close to 512, therefore i suppose that 512 files is the maximum. That assumption may be wrong. Is it possible to change the maximum number of simultaneously opened files? If so, how? 21 cm: the universal wave length of hydrogen
modified on Saturday, April 12, 2008 2:39 PM
As I know of these limits are per process. There is a KB article on this here[^], that may be of value. So your assumptions may be correct. Also there are some obscure registry settings to change the limit on the max handle limit documented here[^].
Work @ Network integrated solutions | Flickr | A practical use of the MVC pattern
-
As I know of these limits are per process. There is a KB article on this here[^], that may be of value. So your assumptions may be correct. Also there are some obscure registry settings to change the limit on the max handle limit documented here[^].
Work @ Network integrated solutions | Flickr | A practical use of the MVC pattern
Hi Zoltan, > There is a KB article on this here[^], that may be of value. It reports 500 per process for NT 4. Seems to be the same for XP. > Also there are some obscure registry settings Those report 10000 handles. Weird. When Googling for an answer, [RedHat] Linux reports 1000 simultaneously opened files as maximum. Fortunately 'decently' recoding the previous mess the solved my agony. Thanks, Henk 21 cm: the universal wave length of hydrogen
-
There must be a maximum number of simultaneously opened files. I found out -the hard way- by a rather strange error, that after opening 507 files, a next file could no longer be opened. After fixing the bug in my programm: closing a file after having processed the information, the error dispappeared, so 507 is close to 512, therefore i suppose that 512 files is the maximum. That assumption may be wrong. Is it possible to change the maximum number of simultaneously opened files? If so, how? 21 cm: the universal wave length of hydrogen
modified on Saturday, April 12, 2008 2:39 PM
You can modify the maximum number of file handles opened simultaneously. I believe the ceiling is 2048 file handles. You can use _getmaxstdio[^] to verify this on your operating system. If you wish to modify this value you can use _setmaxstdio[^] to set the new value. Best Wishes, -David Delaune
-
Hi Zoltan, > There is a KB article on this here[^], that may be of value. It reports 500 per process for NT 4. Seems to be the same for XP. > Also there are some obscure registry settings Those report 10000 handles. Weird. When Googling for an answer, [RedHat] Linux reports 1000 simultaneously opened files as maximum. Fortunately 'decently' recoding the previous mess the solved my agony. Thanks, Henk 21 cm: the universal wave length of hydrogen
henk21cm wrote:
Those report 10000 handles
Yeah but for handles you must count a lot of things like synchronization/event handles, registry key handles, thread handles, ui object handles (pens, brushes, etc) and file handles.
Work @ Network integrated solutions | Flickr | A practical use of the MVC pattern
-
You can modify the maximum number of file handles opened simultaneously. I believe the ceiling is 2048 file handles. You can use _getmaxstdio[^] to verify this on your operating system. If you wish to modify this value you can use _setmaxstdio[^] to set the new value. Best Wishes, -David Delaune
G'day David, > You can modify the maximum number of file handles opened simultaneously. The functions _get and _setmnaxstdio are 2005 and 2008 specific. The project was compiled with the old VC 6.0. > I believe the ceiling is 2048 file handles. Correct, when using the number 2049 in VS 2005, it reports an error. Regards, Henk 21 cm: the universal wave length of hydrogen
-
G'day David, > You can modify the maximum number of file handles opened simultaneously. The functions _get and _setmnaxstdio are 2005 and 2008 specific. The project was compiled with the old VC 6.0. > I believe the ceiling is 2048 file handles. Correct, when using the number 2049 in VS 2005, it reports an error. Regards, Henk 21 cm: the universal wave length of hydrogen
henk21cm wrote:
The functions _get and _setmnaxstdio are 2005 and 2008 specific. The project was compiled with the old VC 6.0.
This is not correct, what gives you this idea? This function is part of the standard C runtime library. Those functions have been around for as long as I can remember. Possibly even MSVC 5.0 I will have to check later. I also still use MSVC 6.0 for some projects... I just checked and it works just fine. The declaration is inside stdio.h on line 340. It exists in the VC6 documentation as well. http://msdn2.microsoft.com/en-us/library/aa298575(VS.60).aspx[^] Best Wishes, -David Delaune
-
henk21cm wrote:
The functions _get and _setmnaxstdio are 2005 and 2008 specific. The project was compiled with the old VC 6.0.
This is not correct, what gives you this idea? This function is part of the standard C runtime library. Those functions have been around for as long as I can remember. Possibly even MSVC 5.0 I will have to check later. I also still use MSVC 6.0 for some projects... I just checked and it works just fine. The declaration is inside stdio.h on line 340. It exists in the VC6 documentation as well. http://msdn2.microsoft.com/en-us/library/aa298575(VS.60).aspx[^] Best Wishes, -David Delaune
G'day David,
Randor wrote:
henk21cm wrote: The functions _get and _setmnaxstdio are 2005 and 2008 specific. The project was compiled with the old VC 6.0. This is not correct, what gives you this idea?
- The link in the previous reply referred to a webpage in which explicitly "VS 2005 and later" was mentioned. 2) When typing _getmaxstdio in the VC 6 help, a messagebox "No topics found" pops up.
Randor wrote:
This function is part of the standard C runtime library. Those functions have been around for as long as I can remember.
And you are absolutely right. I compiled a simple snippet with both (get/set) under VC 6, and it ran flawlesly. Thanks for the additional info. Regards, Henk 21 cm: the universal wave length of hydrogen
-
G'day David,
Randor wrote:
henk21cm wrote: The functions _get and _setmnaxstdio are 2005 and 2008 specific. The project was compiled with the old VC 6.0. This is not correct, what gives you this idea?
- The link in the previous reply referred to a webpage in which explicitly "VS 2005 and later" was mentioned. 2) When typing _getmaxstdio in the VC 6 help, a messagebox "No topics found" pops up.
Randor wrote:
This function is part of the standard C runtime library. Those functions have been around for as long as I can remember.
And you are absolutely right. I compiled a simple snippet with both (get/set) under VC 6, and it ran flawlesly. Thanks for the additional info. Regards, Henk 21 cm: the universal wave length of hydrogen
I'm not sure if your old enough to remember this but in the old MS-DOS days this was achieved by editing a file called CONFIG.SYS in which you could add: FILES=255 http://www.easydos.com/files.html[^] Since Win95 and Win98 was built on top of MS-DOS you could still modify the value in those operating systems as well. If I am not mistaken I believe the default value in Win95 was 60 handles which was set by IO.SYS in the root boot directory unless overridden in CONFIG.SYS. Ahhh the dinosaur age... now I'm feeling old. :sigh: Best Wishes, -David Delaune
-
I'm not sure if your old enough to remember this but in the old MS-DOS days this was achieved by editing a file called CONFIG.SYS in which you could add: FILES=255 http://www.easydos.com/files.html[^] Since Win95 and Win98 was built on top of MS-DOS you could still modify the value in those operating systems as well. If I am not mistaken I believe the default value in Win95 was 60 handles which was set by IO.SYS in the root boot directory unless overridden in CONFIG.SYS. Ahhh the dinosaur age... now I'm feeling old. :sigh: Best Wishes, -David Delaune
Randor wrote:
'm not sure if your old enough to remember this but in the old MS-DOS days this was achieved by editing a file called CONFIG.SYS in which you could add: FILES=255
Yes, i do remember, i'm that old that i've been working with punched paper tape and punched cards. Devising a diode array to translate EBCDIC into ASCII. When running into this limited amount of files, CONFIG.SYS was the first file to look for. Under XP it is 0 bytes, not too much space to hold any info of particular value.
Randor wrote:
If I am not mistaken I believe the default value in Win95 was 60 handles which was set by IO.SYS in the root boot directory unless overridden in CONFIG.SYS.
Under DOS (3.2) it was usually set to FILES=20. The default of 8. "Those were the days", compiling programs into .COM files of 512 bytes or less. FCBS=4,4 LASTDRIVE=Z David, we are growing old, but not grumpy! Regards, Henk 21 cm: the universal wave length of hydrogen