Click here to Skip to main content
13,090,267 members (88,741 online)
Rate this:
Please Sign up or sign in to vote.
See more:
How can one open more than 1000 files simultaneously in Windows 7 and Windows 8?
Please let me know the API or the process by which one can achieve this.

Posted 14-Aug-12 6:00am
Updated 14-Aug-12 6:22am
Wes Aday 14-Aug-12 12:03pm
I highly doubt that you need 1000 files open at the same time. You have a serious design flaw.
Yvan Rodrigues 14-Aug-12 12:21pm
I agree, but I'm interested if it's possible.
Sergey Alexandrovich Kryukov 14-Aug-12 15:46pm
Did you try it? Failed? If there is a limitation, it's a limitation, why breaking through it?
Sergey Alexandrovich Kryukov 14-Aug-12 15:45pm
Richard MacCutchan 14-Aug-12 13:26pm
Please let me know the API or the process by which one can achieve this.

It's called a loop.
Nish Sivakumar 14-Aug-12 13:36pm
--- It's called a loop.

Come now, Richard. Poor comment given the OP's requirement.

1 solution

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

Solution 1

The C runtime has a default limit of 512 open file handles. Considering that parts of .NET are written using the CRT, I assume the same limit holds there too. You may have to P/Invoke _setmaxstdio if you want to increase this limit.
satendra K 14-Aug-12 13:33pm
_setmaxstdio(1000); I tried this api,and it is returning success i.e. it is able to increase the limit. i cross checked using _getmaxstdio(). but actually i am trying to open files using "fopen". when fopen is trying to open more than 512 files fopen is failing.
In some portals i have read that _setmaxstdio is not working in win7.Could you please suggest me other way. i am using c/c++ environment.
Nish Sivakumar 14-Aug-12 13:46pm
I just verified that it works as expected in Windows 7 64 bit using VC++ 2010.
Sergey Alexandrovich Kryukov 14-Aug-12 15:47pm
My 5.
Albert Holguin 14-Aug-12 20:27pm
+5... although not completely sure why you'd ever want to do something like this...

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 14 Aug 2012
Copyright © CodeProject, 1999-2017
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