Example project left a file in the Trash !

DragToFinder.xojo_binary_project in Xojo’s Examples folder.

Run it and drag the txt into a Finder’s window (have to work XPlatform).

Quit, Shutdown, reboot and open your Trash then cry: you have a copy of the file in it !

How can I avoid that file in the Trash ?

It’s supposed to be there after a reboot, it’s your computer cleaning up the temporary folder.
Please calm down, there’s no need to make sensational posts every time you discover a new corner of Xojo.

What an odd little demo, there’s no code I can see that is creating a file at the target of the drop and DragItem.Destination isn’t meant to work outside mac OS but its working on my windows box. Odd

DragItem.Destination is not working for me. Always Nil.

Emile, I don’t have much experience with Xojo, so I don’t know if it’s possible to delete the temp file created by the demo when you close the app. I think if there is no temp file when you reboot you will not get a copy on Trash

Edit: Emile, I followed your instructions and I don’t see a copy in Trash (sorry, I don’t know what XPlatform is)

I think DragItem Destination is not working, found some cases:
<https://xojo.com/issue/16831>
<https://xojo.com/issue/21991>

I see that the example InfoLabel changed from:
2017r2.1

to
2017r3

The drag used in this example can be used as inspiration to drag an image from a Canvas.

From LR:

[code]DragItem.Destination
Jump to: navigation, search
Read-Only Property (As Object )

This property is only available on the macOS platform.[/code]
I do not talked about that (I do not even undestand what it is meant to do).

Drag an image from a Canvas to the Finder / Explorer / Linux desktop (?) works fine, but leaves (macOS, I do not searched on the two other platforms) a copy of the file in the Temporary folder. That clone file appears in the Trash after a reboot.

XPlatform: Multiple platforms (Linux, macOS, Windows).

Some weeks ago, someone in this forum was talking about files leaving by an application (his application) in the Trash or in a folder / somewhere in the user’s hard disk and none was telling about sensation…

More or less.

If you put a file in the temporary folder, yes, this is how the OS works.

But I do not want to spoil the user’s hard disk with files generated by my application.

That said, there are only two cases:
a. No one add the drop to Finder / Explorer / Whatever name for Linux feature,
b. No one care about that.

This is a bit strange for a 20 years old software, but probably only for me.

Emile, sorry that I talked about DragItem Destination. It is not related to your problem just related to the Example code.

I wanted to reproduce your issue, but I was not able to do it. The only thing I have in Trash is an empty Recovered Files folder. I’m using 10.12.6

I wanted to reproduce the problem and try to use f.Delete at the end of the MouseDown event to see if there is any change. Maybe you can try it.

That’s what’s being discussed. It’s really not a big deal, it comes around The Circle of Topics™ every once in a while.