Click here to Skip to main content
11,719,903 members (81,668 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Win7
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
Edited 14-Aug-12 6:22am
Wes Aday at 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 at 14-Aug-12 12:21pm
I agree, but I'm interested if it's possible.
Sergey Alexandrovich Kryukov at 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 at 14-Aug-12 15:45pm
Richard MacCutchan at 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 at 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 at 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 at 14-Aug-12 13:46pm
I just verified that it works as expected in Windows 7 64 bit using VC++ 2010.
Sergey Alexandrovich Kryukov at 14-Aug-12 15:47pm
My 5.
Albert Holguin at 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
0 Sergey Alexandrovich Kryukov 685
1 OriginalGriff 255
2 F-ES Sitecore 225
3 Suvendu Shekhar Giri 140
4 Maciej Los 100
0 Sergey Alexandrovich Kryukov 1,869
1 OriginalGriff 770
2 F-ES Sitecore 640
3 Maciej Los 609
4 Richard MacCutchan 540

Advertise | Privacy | Mobile
Web04 | 2.8.150901.1 | Last Updated 14 Aug 2012
Copyright © CodeProject, 1999-2015
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