CreateAsFolder issue

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?

Which Xojo version?

2018 release 2

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

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

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

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

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

~/library

not

~library

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

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

Thanks, it’s indeed in that hidden directory