Post

Replies

Boosts

Views

Activity

trashItem, recycle, but no put back option...it depends
Hi all, I use the FileManager trashIitem function to put a file in the trash. If it is only one file, then the option to put it back is available. If, however, several files are deleted, the option to put it back is only available for the first deleted file. All others cannot be put back. The problem has been known for at least 10 years. See Put back only works for the first file. NSWorkspace recycle has the same problem. It seems to be due to .DS_Store in the trash. The files that are in the trash are stored there. This may also lead you to believe that the trashItem function is working properly because the deleted files are still in the .DS_Store file. If I call trashItem or recycle several times and wait 2 seconds between calls, then the option to put it back is available for all of them. That obviously can't be the solution. Waiting less than 2 seconds only offers to put the first file back. So trashItem and recycle are the same as remove, with the difference that you can look at the files in the trash can again, but not put them back. Are there other ways? The Finder can also delete multiple files and put them all back.
2
0
222
4w