Jump to content

(beta 3.1.1.84) the maximum number of open files has been exceeded


Recommended Posts

$ap = 0
While 1
    FileOpen("rga.sav", 2)
    FileWrite("rga.sav", '$ap = ' & $ap)
    FileClose("rga.sav")
    $ap = $ap + 1
WEnd

On Version 3.1.1.0 it works perfectly. But on Versio 3.1.1.84 beta this error appears:

Unable to open file, the maximum number of open files has been exceeded.:

FileOpen("rga.sav", 2)

I know that the maximum number of open files _in the same time_ is 64, but FileClose should solve this problem.

Greets.

Link to comment
Share on other sites

$ap = 0
While 1
    FileOpen("rga.sav", 2)
    FileWrite("rga.sav", '$ap = ' & $ap)
    FileClose("rga.sav")
    $ap = $ap + 1
WEnd

Greets.

Ermmm....

$ap = 0
While 1
    $FileHandle = FileOpen("rga.sav", 2)
    FileWrite($FileHandle, '$ap = ' & $ap)
    FileClose($FileHandle)
    $ap = $ap + 1
WEnd
Link to comment
Share on other sites

The doc say FileWrite("filename") must not be mixed with FileOpen("filename")

Note: Do not mix filehandles and filenames, i.e., don't FileOpen a file and then use a filename in this function.Either use filehandles or filenames in your routines--not both.

Perhaps some code cleaning in the beta make this statement really true now B)

Link to comment
Share on other sites

it was working due to a bug in 3.1.1

the fileClose cannot use a filename but the integer value of a string is 0 so it was closing the file open by Fileopen.

It was just a luck.

I correct Fileclose to avoid closing the first open file and you get now the correct behavior whatever the doc say about the not mixing stuff.

B)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...