File Permissions right after boot

MichaelAust

Member
Licensed User
Longtime User
I have a program which runs at boot, but when it attempts to read a file from DirRootExternal I get permission errors (File.Exists() appears to return true in this case). The file reads without errors when I run the program in the normal way (ie. not at boot).

I have tested this with a simpler program (see the attached project). With this project I delayed the loading of the file using a timer, and when I set it to 1 millisecond and reboot the emulator, File.Exists() appears to return False (MsgBox does not pop up), but when I set it to 10000 (10 sec) MsgBox does pop up, and it has loaded the file.

Is there a period after boot, during which the B4A file permissions are not set yet ? If so, how can I test it, as a timer seems an unreliable way to determine when it is safe to read a file.
 

Attachments

  • StartAtBootLoadFile.zip
    9.9 KB · Views: 220

MichaelAust

Member
Licensed User
Longtime User
No.

Have you tested it with a real device?

No I hadn't, but I just did with no timer delay, rebooted, and it worked as it should with no errors. So I guess the emulator is not representative of a real device. I assumed it was, but just slower.
 
Upvote 0
Top