Just playing around with File handling, I created a small program to open and read a small sqlite database. I used the SpeciaFolder currentworkingdirectory (which turnes out to be my home folder on my machine), plus a couple of child extensions to point to the file I wanted. The program worked fine running from the IDE, but when compiled using build, it crashed with a nilobjectexception error. This happened only when invoking a an open and read method. I finally determined that it wasn’t finding the file I wanted. I changed the Filefolder variable to use the native path to the file, and now it runs fine after compiling it again. Can anyone explain why my Specialfolder method works from the IDE but not from a built version. I am running Linux Mint V20.3
The value for SpecialFolder.CurrentWorkingDirectory varies based on where and how you run your app. If you really want your home folder than you should use SpecialFolder.UserHome.
Thank You . Appreciate your response. I will try your suggestion.
Also, it’s always a good idea to check against nil in your code (may it just be to show a message dialog) rather than assume a hardcoded file will always be found (e.g. the system may block access to the file).