OS X file path?

I am trying to convert my Windows app to an OS X app.

Could someone please tell me if the following PATH is valid on OS X?

db = new REALSQLDatabase db.DatabaseFile = GetFolderItem("Support Files").child("IR.db")

Every time I build my app for OS X, the app refuses to start and an error message says that my app cannot be opened due to a problem and that I need to check it is compatible with my version of OS X?

Therefore, I have a feeling the paths to my database files may be wrong.

Thanks in advance.

Does OS X allow an application to access/modify it’s install folder/DMG? A REALSQLDatabase opens the database file for reading and writing. I ask because this:

db.DatabaseFile = GetFolderItem("Support Files").child("IR.db")

Is equivalent to this:

db.DatabaseFile = App.ExecutableFile.Parent.Child("Support Files").child("IR.db")

That’s where I would start looking, anyway. I’m not too familiar with OS X.

On a USB stick I have my app, and a folder containing the database files.
Does this means it is impossible to run an OS X app on a USB stick?

Someone more familiar with OS X will have to answer that, but it would seem an odd limitation.

msgbox GetFolderItem(“Support Files”).child(“IR.db”).nativepath

A) does the above return what you feel the full correct path should be?
B) if db.dadtabasefile nil?

I am assuming the “Support Files” is something you created… and its physical location would change based on a compiled vs debug version… Perhaps you mean to be using an offshoot of the SPECIALFOLDER function?

My app is compiled and being run from the root of a USB stick.
Also in the root of the USB stick is a folder called “Support Files” which contains the native Xojo database files (SQLite) used by my app.

Everything works fine on Windows, but refuses to run on OS X.

Maybe a problem with permissions.

dim f as FolderItem = GetFolderItem(“Support Files”).child(“IR.db”)
MsgBox str(f.Permissions)

Have you tried db.DatabaseFile = App.ExecutableFile.Parent.Parent.Parent.Parent.Child(“Support Files”).child(“IR.db”) ?

If you right-click on your app and click “Show Package Contents” the child “contents” is revealed
Double-click “Contents” the child “MacOS” is revealed
Double-click “MacOS” the child “App.ExecutableFile.” is revealed

… so that is child/child/child
so the file containing your executable is the parent of your app

… so that is App.ExecutableFile.Parent.Parent.Parent.Parent

I would have write

GetFolderItem("").Child("Support Files").child("IR.db")

as GetFolderItem("") return the path of the parent folder of the application itself (then the USB stick as your app is at the root of it).