B4J Question [RESOLVED] File.DirApp on package File MAC

MarcoRome

Expert
Licensed User
Longtime User
Hi All.
Houston we have a problem ?
As explained in this post.

When the package is packaged using Macsigner and becomes a single file, the File.DirApp directory is no longer usable.
Now with "temporary" files such as PDFs that are loaded, Excel files that are saved can be moved to the File.DirTemp folder and everything works properly.
But if a file must be persistent, such as a db, which directory can it be moved to ?

Looking at the following documentation, I don't think there are any valid alternatives.


Any suggestion ?
Thank you
Marco
 
Last edited:

MarcoRome

Expert
Licensed User
Longtime User
More information.
I did some tests.
if you use the following code

B4X:
Dim tempDir As String
    tempDir = File.Combine(File.DirApp, "TempFolder")
   
    Log(File.DirApp)
  

    ' Crea la directory di appoggio se non esiste già
    If File.Exists(tempDir, "") = False Then
        File.MakeDir(tempDir, "")
        fx.Msgbox(MainForm, tempDir,"")
    Else
        fx.Msgbox(MainForm, tempDir,"**ESISTE**")
    End If

using run.command you have the following result (correct and folder is created )



using package file you have the following result and no folder is created

 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
Upvote 0