Catalina and SpecialFolder.Temporary

I start a new thread so we can address that particular issue.

I just confirmed under Catalina, one of my apps is broken since SpecialFolder.Temporary reports isWritable as false for a sandboxed app.

I am in the process of refactoring to use instead a Temp subfolder of ApplicationData.

Wouldn’t it be a Xojo Bug needing a fix? In another thread Sam said something related to Xojo possibly needing an API upgrade in this part.

[quote=442641:@Beatrix Willius]I did a simple test with

dim f as FolderItem = SpecialFolder.Temporary
f = GetTemporaryFolderItem

and both give back nil.[/quote]

[quote=442666:@Stphane Mons]SpecialFolder.Temporary and GetTemporaryFolderItem are still using Carbon calls, I guess, and they require a TemporaryItems folder to be created within $TMPDIR.

Maybe Catalina no longer supports it or Carbon calls are trying to use FSRef.[/quote]

Xojo fixed the problem.

The problem was and is that the specialfolder stuff works until it doesn’t. I had one user last week doing a test where specialfolder.applications was not there in one execution of the test and there the next.

Right now I replaced SpecialFolder.Temporary with a temp folder within Specialfolder.ApplicationData/com.matchsoftware.myapp

BTW, Beatrix, Specialfolder.ApplicationData is not broken.

Don’t jinx it!

Hahahahahha… thanks, Sam, for making me laugh. It’s great the specialfolder.ApplicationData works. But that doesn’t help for the broken Specialfolder.applications. And if Michel uses a Mutex then he is out of luck anyways.

I don’t use Mutex on Mac. The system prevents launching a new copy of the same software anyway.

My problem is I need a Temp folder as a scratchpad.

Of course, it would be a lot better if there was no bug in Specialfolder under Catalina. Hopefully Xojo is working on that.

Copy YOUR application and run the two of them…

Unless, Catalina refuse to make application(s) copie(s)…

[quote=457070:@Emile Schwarz]Copy YOUR application and run the two of them…

Unless, Catalina refuse to make application(s) copie(s)…[/quote]

There will always be ways for users to mess up. They probably also neglect to change tires on their car, and set their house on fire with hazardous electricity wiring. Pity. I am not shedding a tear for loonies.


I ust recall that Firefox reject the load of a second Firefox application with a message.

This can happens when the application already run and you drop a document on the Dock icon (and that icon points to a different application).
This can happens when you have an external hard disk. It can be pure hazard (not done to annoy the application creator).

Mutexes appear to be working okay for us.

From the problems we are seeing it looks like Apple have further broken FSRef based APIs in macOS 10.15. As soon as you start putting files into the temporary folder weird stuff happens.
• Another application cannot access your temporary files if it has a different bundle ID.
• If you copy a file into the temporary folder and it has extended attributes applied you cannot access it properly.

This code

[code]system.DebugLog SpecialFolder.Temporary.ShellPath

dim s as new shell
s.execute(“echo $TMPDIR”)
system.debuglog s.Result[/code]

Produces :

/var/folders/tt/tcp7xlks3xn3zpr6zlbzy4jm0000gn/T /var/folders/tt/tcp7xlks3xn3zpr6zlbzy4jm0000gn/T/

In other words, Xojo indeed points to the proper folder. So it is indeed Catalina not behaving like previous macOS which allowed access to the temporary folder.

For some reason, Catalina prevents Xojo apps to access the temporary folder.

I opened the temporary folder from the command line with


And dropped a file in there. No error. So it would seem the user can access that folder, but not a program.

The plot thickens…

[quote=457093:@Michel Bujardet]…
No error. So it would seem the user can access that folder, but not a program.

The plot thickens…[/quote]
For us, access isn’t 100% broken as our application can perform basic file IO actions to the temporary folder.
The tests we performed during the Catalina beta seems to indicate a strange integration between FSRef based APIs and the temporary folder. Some (maybe all) of these issues disappear when you use newer file system APIs (ie: built using Xojo 2019r2).
We currently have 3 open cases with Apple going back to August with two of them not receiving a response so I am not very hopeful that this will be addressed.

What makes this worse is that Xojo left it to the very last minute to update the macOS APIs being used for FolderItem and rolling that muchly needed improvement into the same release as a major change (v2 API) making it difficult for users to respond quickly.

Apparently, indeed, 2019R2 just released seems to be able to access temporary under Catalina.

Just to be clear, what I wrote above applies to our application compiled with Xojo 2017r3 so access isn’t completely broken if you aren’t using Xojo 2019r2.