PRB: Too Many Files Open Running VFP on Windows Terminal Server
ID: Q219956
|
The information in this article applies to:
-
Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0, 5.0a, 6.0
-
Microsoft FoxPro for Windows, versions 2.6, 2.6a
-
Microsoft Windows NT Server version 4.0, Terminal Server Edition
SYMPTOMS
When running Visual FoxPro applications through Windows Terminal Server, the following error message occurs if more than 2048 file handles are open:
Too many files open
CAUSE
Terminal Server has a limitation of 2,048 open files per connection. Because all users use the same connection, a file-intensive application may fail when the limit is reached.
MORE INFORMATION
The error message indicates that FoxPro for Windows or Visual FoxPro has attempted to open more than its internal limit of files. This behavior and the resulting error message occur as a result of limitation of 2048 open file handles in Windows NT Terminal Server.
Steps to Reproduce Behavior
- Initiate a connection to a Windows NT Terminal Server.
- Using the connection to Windows NT Terminal Server, launch a session of FoxPro for Windows or Visual FoxPro.
- Create a program file called "MAXFILES.PRG", using the following code:
FOR i=1 TO 684
SELECT 0
make_cmd="create table test"+ALLTRIM(STR(i))+" (var1 c(10), var2 m)"
*!* Open one file handle for each table created
*!* Open a second file handle for each fpt file
&make_cmd
select_table="test"+ALLTRIM(STR(i))
SELECT (select_table)
index_cmd="index on var1 tag junk of test"+ALLTRIM(STR(i))
*!* Open a third file handle for each index created
&index_cmd
NEXT
- From the Command window, type "DO MAXFILES."
- Observe that the program will error out with the following error message:
Too many files open
- Click Suspend
- From the Command window, type the following code:
? i
? i*3
Note that the value for i that is displayed is 683, and the value that is displayed for i*3 is 2049.
REFERENCES
For additional information about Microsoft Windows NT Server version 4.0, Terminal Server Edition, please see the following
article in the Microsoft Knowledge Base:
Q190162 Terminal Server and the 2048 Open File Limitation
Additional query words:
Keywords : kberrmsg KbClientServer kbVFp kbVFp300 kbVFp500a kbVFp600 kbGrpFox
Version : WINDOWS:2.6,2.6a,3.0,3.0b,5.0,5.0a,6.0; winnt:4.0
Platform : WINDOWS winnt
Issue type : kbprb