BadButterfly Posted October 26, 2005 Share Posted October 26, 2005 $ap = 0 While 1 FileOpen("rga.sav", 2) FileWrite("rga.sav", '$ap = ' & $ap) FileClose("rga.sav") $ap = $ap + 1 WEndOn 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 More sharing options...
SumTingWong Posted October 26, 2005 Share Posted October 26, 2005 $ap = 0 While 1 FileOpen("rga.sav", 2) FileWrite("rga.sav", '$ap = ' & $ap) FileClose("rga.sav") $ap = $ap + 1 WEndGreets. 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 More sharing options...
jpm Posted October 26, 2005 Share Posted October 26, 2005 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 Link to comment Share on other sites More sharing options...
jpm Posted October 26, 2005 Share Posted October 26, 2005 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now