• 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

Fixed CreateDir() doesn't work like suggested in the docs

Martin

Well-known member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
3rd Party Tool Dev
Joined
Jun 19, 2017
Messages
344
As the title says. Docs say that using
Code:
CreateDir("cerberus://internal/logs")
a directory should be created.

Actually you have to do:
Code:
CreateDir("internal/logs")

At least for Windows...
 
You are talking about CreateDir from module filesystem and not os, right?
I guess I can look into this at the weekend. To me it looks rather like a bug in functionality than in documentation.
If CreateDir("internal/logs") works, this would either mean that the working directory is the app folder or relative paths don't work properly.
Both is not congruent with the multiplatform way of CX .
 
Oh yes I mean the one from brl.filesystem.

Same is true for DeleteFile and CopyFile by the way. Haven't checked the others. And yes it seems to work pretty well using the app folder as working directory.
 
Quick fix:
Replace CreateDir in brl.filesystem with this version:
Cerberus:
Function CreateDir:Bool( path:String )
    Local _ret:Bool = False
    'path = path.Replace("\","/")
    path = FixPath( path )
    Local _dirs:= path.Split("/")
    Local _curDir:=""
    For Local _dir :=Eachin _dirs
        If _dir.Length()= 0 Continue
        _curDir += _dir
        If FileType(_curDir)<>FILETYPE_DIR
            _ret = BBFileSystem.CreateDir( FixPath( _curDir ) )
        Endif
        _curDir += "/"
    Next
    Return _ret
End

That should do the trick with creating directories with cerberus://internal.
Regarding CopyFile... with CopyFile make sure the target path already exists. Or would you expect to create the path too, if it doesn't?

And with DeleteFile... you say it doesn't work? Works fine here.

If you have set #GLFW_APP_LABEL and optional #GLFW_APP_PUBLISHER then the internal directory is located inside your user directory in APPDATA/Roaming/....
For an example...

1607713169594.png
 
Ah, of course the %APPDATA% path. Haven't thought of that. So on Windows it should be all put there right? As you usually shouldn't store any stuff outside that appdata path anymore?
 
It does that only if you have set #GLFW_APP_LABEL. If not, it will use the internal folder next to your app.
 
Ok everything works fine, thanks! :)

Regarding CopyFile... with CopyFile make sure the target path already exists. Or would you expect to create the path too, if it doesn't?

No all good, don't need that!
 
Back
Top Bottom