CreateAsFolder issue

  1. 6 months ago

    Vincent V

    13 Dec 2018 Amsterdam, The Netherlands

    I'm having an issue with CreateAsFolder on MacOS (tested on High Sierra 10.13.6)

    This code works:

    dim f as FolderItem = SpecialFolder.Documents
    f = f.child("NewFolder")
    f.CreateAsFolder

    It also works with SpecialFolder.Desktop (a folder is created).

    But it doesn't work with SpecialFolder
    .ApplicationData,
    .Applications,
    .CurrentWorkingDirectory
    .Resources
    .Temporary

    and many others. No folder is created.

    Any idea what's wrong?

    @Vincent V -image-

    ~/library
    not

    ~library

    the ~library means the user “library” home directory.

  2. Roger C

    13 Dec 2018 Lewis Center, OH

    Which Xojo version?

  3. Vincent V

    13 Dec 2018 Amsterdam, The Netherlands

    2018 release 2

  4. Jeff T

    13 Dec 2018 Pre-Release Testers Midlands of England, Europe

    Sounds like a permissions problem.

    .ApplicationData should work
    .Applications, should not work .. you need elevated permissions to write there
    .CurrentWorkingDirectory should not work .. you need elevated permissions to write there because it is normally 'Applications'
    .Resources should not work - this is read-only to you
    .Temporary should work

  5. Roger C

    13 Dec 2018 Lewis Center, OH

    I hadn’t tried with 2018.4 is why I asked, but my apps use .ApplicationData a lot with no issues.

  6. Vincent V

    13 Dec 2018 Amsterdam, The Netherlands

    Maybe it's a bug in Xojo. According to the documentation, the ApplicationData path is: /Users/UserName/Library/Application Support
    But in reality, on High Sierra at least, the Application Support folder is not in that path. It's not in the Users directory. It's in:
    Macintosh HD/Library/Application Support

    -image-

  7. Roger C

    13 Dec 2018 Lewis Center, OH

    No. That’s not the folder to which you are writing. Select “go to folder...” from the menu then type ~library/ and click go. Look in that ApplicationData folder and I’ll bet you see your files

  8. Vincent V

    13 Dec 2018 Amsterdam, The Netherlands

    -image-

  9. Dave S

    13 Dec 2018 San Diego, California USA

    by default that folder is marked as hidden by macOS
    Google and you can find the terminal command to un-hide it

  10. scott b

    13 Dec 2018 Pre-Release Testers, Xojo Pro Answer local coffee shop

    @Vincent V -image-

    ~/library
    not

    ~library

    the ~library means the user “library” home directory.

  11. Roger C

    13 Dec 2018 Lewis Center, OH

    Sorry, I typed the path wrong. Scott has shown you the correct

  12. Vincent V

    13 Dec 2018 Amsterdam, The Netherlands

    Thanks, it's indeed in that hidden directory

or Sign Up to reply!