Restrictions on the number of file handles opened by Windows system processes

Source: Internet
Author: User

In a Linux system, the limit of the number of file handles open by a process can be viewed and modified using the Ulimit command, or modified/etc/security/limits.conf may also be modified. However, there is no convenient way to view this value in Windows.

The following code can be used to view the value, and the set method has not been found.

The value of the program under Windows Server 2003 is 509, plus standard I/O and standard error file handles, and the system should be 512. Other Windows systems can try the following code if needed.

int _tmain (int argc, _tchar* argv[])

{

FILE *p;

P=fopen ("E:\\first.txt", "RB");

if (p==null)

{

printf ("\nerror on Open e:\\first.txt file!");

}

int i = 1;

while (P!=null)

{

P=fopen ("E:\\first.txt", "RB");

printf ("%d\n", I);

i++;

}

return 0;

}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.