BUG: FERROR() Returns 5 When File Handles Exhausted

ID: Q130606

The information in this article applies to:

SYMPTOMS

The FERROR() function returns 5 when a file cannot be created because no file handles are available. The FERROR() function should return 4 when a file cannot be created due to insufficient file handles.

RESOLUTION

Instead of checking for a return value of 4, check for a return value of 5. The error 5 should mean Access Denied.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

Create and run this program:

cnt = 1 DO WHILE cnt <= 400

    myfile = "TF_"+STR(cnt,3,0)
    fret = FCREATE(myfile)
    IF fret = -1
        ? FERROR()
        EXIT
    ENDIF
    cnt = cnt + 1
ENDDO

Additional reference words: 2.60a FoxWin buglist2.60a KBCategory: kbprg kbbuglist KBSubcategory: FxprgGeneral

Last Reviewed: June 27, 1995