This simple code works as it should in Debug (both rapid and legacy), but it doesn't work in Release.
The MsgBox is just there to test that I actually get there.
When run in debug, the file is deleted, as expected. When run in release, nothing happens. The File.Delete is run, but the file remains. No error is thrown, and I get the MsgBox, so execution at least reaches that line.
Am I just very stupid and missing something obvious, or is this a compiler bug?
Edit: I have, of course, checked filename and path, and it's correct and the same.
Edit 2: Same strange results on two different devices.
B4X:
Try
File.Delete(FilePath ,FileName)
Msgbox(FilePath & CRLF & FileName,"Deleted")
Catch
ToastMessageShow("Couldn't delete file: " & FileName, True)
End Try
The MsgBox is just there to test that I actually get there.
When run in debug, the file is deleted, as expected. When run in release, nothing happens. The File.Delete is run, but the file remains. No error is thrown, and I get the MsgBox, so execution at least reaches that line.
Am I just very stupid and missing something obvious, or is this a compiler bug?
Edit: I have, of course, checked filename and path, and it's correct and the same.
Edit 2: Same strange results on two different devices.
Last edited: