Check if file exist - SOLVED

Hi, i’m new to forum.
I have made a simple app, one button save a text file, and save to tinyDB the name of file.
When i open the app i call “get value” to read the file name from DB, and then read the file.
If file exist i put the text in a label.
With a second button i made the same (read from file).
If i delete the file manualy, when i start the app don’t have an message error (file not found), but when i push the second button i have it?
thanks paolo

Another thread on the same subject from just 1 day ago

Grazie, avevo letto questo tread, ho usato proprio il consiglio di intercettare l’errore. Ma vorrei capire perchè non funziona non come farlo!

Thanks had read threads, I have used error check, but i want to know why don’t work not how do it.

paolo

I believe it is a timing issue on start up. If you introduce a clock (I used 100ms) then the error will show:

As this is a possible bug will report up to MIT

Try this:

Thank You. In this way now it work. With probability it is a bug. I report it. Paolo :+1: :+1:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.