I have some Java programs that write some files to the desktop, read them, check them, and delete them. This might happen to about 50 files. Sometimes a few files remain on the desktop. The ones that remain seem random. I used to try to delete them but I resented doing that. I don't remember if deleting actually works but today I find that I can't delete the file. I discovered that after rebooting the files are gone.
Why is this happening?
There is a padlock icon on top of the icon of the file itself. The same program invocation can also result in no padlock icon on top of the file icon. If I right click the file icon in order to "move to trash" there is a dialog that says
“Test Range.txt” can't be put in the trash. Do you want to delete it immediately?
If I choose to delete it immediately it says
Error while deleting. Error when getting information for file '/home/jack/Desktop/Test Range.txt': No such file or directory
If I do ls -la
the file is not present even though it is visible on the desktop.
I'm using Java 8 update 112 but I think this problem has been around since earlier versions of Java. I'm also using Ubuntu 16.04.
Addendum: In response to a request for more information I was asked to issue the command:
apt-cache policy nautilus nautilus-data
That command results in:
nautilus:
Installed: 1:3.18.4.is.3.14.3-0ubuntu5
Candidate: 1:3.18.4.is.3.14.3-0ubuntu5
Version table:
*** 1:3.18.4.is.3.14.3-0ubuntu5 500
500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
100 /var/lib/dpkg/status
1:3.18.4.is.3.14.3-0ubuntu4 500
500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
nautilus-data:
Installed: 1:3.18.4.is.3.14.3-0ubuntu5
Candidate: 1:3.18.4.is.3.14.3-0ubuntu5
Version table:
*** 1:3.18.4.is.3.14.3-0ubuntu5 500
500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages
100 /var/lib/dpkg/status
1:3.18.4.is.3.14.3-0ubuntu4 500
500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu xenial/main i386 Packages