I opened a write-protected and locked PDF-file with the Preview app. Originally it was located within a folder at the desktop.
Afterwards, I moved the file within its folder to a different location.
After some time, the containing folder reappeared at the desktop but without any content in it.
It has been some days since then and I rebooted several times. The folder just keeps reappearing. I delete it, it somehow gets recreated by some application after some minutes.
I even unlocked the PDF-file, moved it back and forth. I also deleted the folder with sudo in the terminal. It says that "staff" is the owner. But it keeps reapperaring.
What could I do? Can I see why the folder was created?
while :;do sudo lsof ~/Desktop/<folder name> 2>/dev/null; done
(replace<folder name>
with the name of the folder that keeps reappearing) and press Enter (you will most probably need to type your password once). With a bit of luck this loop should print the process that creates the folder (you may need to delete the folder several times and wait for it to be recreated).