Hello all again. Here's another bug I've found this week. This time it's with the directory reading routines.
When deleting a file within the program, the commands GetFirstFile() and GetNextFile() do not realise that the file has gone.
// set window properties
SetWindowTitle( "DeleteBug" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
// Create a few files first
for iter = 0 to 9
iFile = opentowrite("Random file " + str(iter))
closefile(iFile)
next iter
do
print("Press d to delete file 5")
if (getrawkeypressed(68))
deletefile("Random file 5")
endif
PrintFileList()
Print( ScreenFPS() )
Sync()
loop
function PrintFileList()
fn$ = getfirstfile()
while fn$ <> ""
print(fn$)
fn$=getnextfile()
endwhile
endfunction
Clicking away from the app's Window, e.g. on the desktop, then clicking back to the app suddenly causes it to reassess its situation and suddenly the file disappears from its list.
Would anyone mind confirming that this is a bug, please?
Thanks very much,
James