• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

Writing to ˜/Library/Application Support/

Pierrou

Well-known member
Joined
Jul 6, 2017
Messages
237
Hi there
I'm stuck for months with the same problem I really don't know what to do.
I'd like to store some prefs/files (images) in some directory for my app and the dirs and files are just not created when I try, but, again, I have no clue about how to do it on MacOS (High Sierra)
If I use
Code:
#GLFW_APP_LABEL="SyntagmaToons"
#GLFW_APP_PUBLISHER="SiliceEtSynapses"
A directory SiliceEtSynapses is created as well as a SyntagmaToons subdirectory in ˜/Library/Application Support/ but then I can't get to write anything inside it.
whether I use
Code:
"/Users/"+GetEnv("USER")+"/Library/Application Support/SiliceEtSynapses/SyntagmaToons/"
or
Code:
"cerberus://internal/"
as a path to create stuff using CreateDir for example.

What am I doing wrong?
Thanks if you can help before I go crazy!

EDIT : Using
Code:
CopyFile("cerberus://data/image.png","cerberus://internal/copiedimage.png")
does copy the image inside /Library/Application Support/SiliceEtSynapses/SyntagmaToons/ but using CreateDir for example does nothing

EDIT 2 : OK in fact I can create a text file and append some text to it inside cerberus://internal/ but I can't create /or copy/ any folder to that directory why is it so?
 
Last edited:
I tried the example from the helpfile for the filesystem module and couldn't create folders either. I am on Big Sur.
Sorry, but my knowledge with macOs is very limited, so I can't help with that.
 
Looks like a bug to me or at least a missing feature. Will try to add it.
 
Thanks a lot to both of you!
I can use a workaround avoiding to create folders but I guess it would be nice if CreateDir/CopyDir could work on MacOS too.
(EDIT : this is the last issue preventing me from releasing a Mac version of my latest app so more sales [and more trouble] ahead)
 
Btw. "cerberus://internal/" get translated to


String( getenv( "HOME" ) )+"/Library/Application Support";

on Apple. I think that differs from "/Users/"+GetEnv("USER")+"/Library/Application Support/"
 
Thanks for that info, I switched to using "cerberus://internal" everywhere anyway
 
Nevermind, I think you reach to the same place. Anyway, there was a bug inside CreateDir.

In modules/brl/filesystem.cxs please replace the CreateDir function with this one:

Code:
Function CreateDir:Bool( path:String )
    Local _ret:Bool = False
    path = FixPath(path).Replace("\","/")
'Print("++ "+path)
    Local _dirs:= path.Split("/")
    Local _curDir:=""
If path.StartsWith("/") Then _curDir = "/"
    For Local _dir :=Eachin _dirs
        If _dir.Length()= 0 Continue
        _curDir += _dir
        If FileType(_curDir)<>FILETYPE_DIR
            _ret = BBFileSystem.CreateDir( FixPath( _curDir ) )
            'Print(">> "+FixPath( _curDir ))
        'Else
            'Print(_curDir)
        Endif
        _curDir += "/"
    Next
    Return _ret
End
 
Back
Top Bottom