Can't Drag and Drop a file promise into /tmp

This happens with my own code as well as with the Apple example code here: Supporting Drag and Drop Through File Promises

When dragging a file promise, the above example code will fail if the destination is in /tmp. It will print out the following message to the console:

An error occurred while attempting to get a unique promise file URL. Error: Did not receive a valid URL.

It doesn't seem to fail if you create a directory inside /tmp and drop into that. But dropping in /tmp fails 100% of the time. And it fails for MacOS Versions from Sequoia all the way up to the most recent Golden Gate beta.

Using /tmp as a destination should most certainly be allowed, but if for some reason it isn't, is there any way in my own code to detect the drop destination and perhaps warn the user that they need to drop somewhere else?

To reproduce this error, use the following steps:

  1. Download the Apple example code from the link above
  2. Open the project in Xcode, build it, and run it
  3. Drag any image into the example app's main window
  4. Open a Finder window and navigate to /tmp
  5. Drag the image from the example app into the /tmp directory in the Finder window.

You will see the above error in the Xcode console and the drop will fail.

Can't Drag and Drop a file promise into /tmp
 
 
Q