LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I increase the number of opened files in LabWindows?

There's a Win32 function _setmaxstdio, but it doesn't seem to be included in the stdio.h version in LabWindows.  I'm using the fopen call and it's limited to 512 opened files.  MSDN help says to use the _setmaxstdio function.  Is there anyway to do this with the LabWindows compiler?

Thanks!

 

0 Kudos
Message 1 of 3
(3,394 Views)

This number is defined in stdio.h as FOPEN_MAX and it is set to 255. Are you using fopen to open your files? _setmaxstdio is not supported for CVI. Why do you need to have more than 512 files open at one time?

 

I am going to go ahead and say that this is not recommended. This can put a heavy strain on your system and can also suffocate your OS of file descriptors (remember that other applications and your OS itself will be opening files as well). Likely there is another way to architect your application so that you do not need that many files open at one time. Typically you do not leave files open. You open, read/write, then close.

National Instruments
0 Kudos
Message 2 of 3
(3,367 Views)

I ended up using OpenFile instead of fopen - there was no limit of 512 on OpenFile.  I agree that it's not ideal to have so many files open, but it is necessary for a huge data processing application (all the files are temporary).

Thanks,

AMM

0 Kudos
Message 3 of 3
(3,355 Views)