Deleting Files With Item

This started as me trying to figure out if there was a way to delete a linked attachment, as I noticed that when I delete the link item or parent item in Zotero, the file it was linked to stays on my hard drive. So, is there any way to do this?

But then I thought, "Wait, what happens when you delete a file stored in internally?" So I added a new file, used Show File to see what folder it was stored in. Then I deleted the file item in Zotero. File still exists in internal storage on the hard drive. I look in the Zotero Trash, item is *not* there. I restart Zotero, can't see item in Trash, but it's still on the hard drive. I purge the trash. Item is still on the hard drive.

So:

(a) Is it possible to delete the linked *file* from within Zotero?
(b) Is the behavior regarding the persistence of internally stored files an error, or do I really just not understand Zotero's storage model?

Zotero Standalone 4.0.17
Linux Mint 13
  • (a) Is it possible to delete the linked *file* from within Zotero?
    No, unless ZotFile/Zutilo offers this function. The idea is that in Zotero a link to a file is the same as a shortcut on your computer. If you delete a shortcut, you shouldn't delete the file.
    (b) Is the behavior regarding the persistence of internally stored files an error, or do I really just not understand Zotero's storage model?
    Looks like a bug. A stored attachment should be deleted once you empty the trash. Did you maybe have the file open in some other program? If you can reproduce this consistently, please provide a Debug ID for an attempt to delete the item _and_ empty the trash.
  • (a) Is it possible to delete the linked *file* from within Zotero?
    No. Zotero doesn't do anything to files outside of its storage directory (which is part of the reason linked files also aren't synced).
    (b) Is the behavior regarding the persistence of internally stored files an error
    Yes, that shouldn't happen. If you can reproduce this easily, provide a Debug ID for a deletion of an attachment from the trash (not moving to the trash, since that doesn't affect the file on disk) that doesn't cause the file to be deleted.
  • OK, so if you select "Move to Trash", the item moves to trash and then "Empty Trash" cleans up the file (Debug ID = D295490358). But if you hit the Delete key, the item disappears, but does not appear in the trash (Debug ID = D1172921211).

    Which of course raises the question, what is the Delete key supposed to do? I notice that when I select the item in the library, if I go to the Edit Menu the Delete option is grayed out. But the Delete key still works, perhaps unexpectedly?
  • Read through this: http://www.zotero.org/support/collections_and_tags#collections

    Delete, when viewing inside a collection, removes item from said collection. When viewing item in My Library, it will move item to trash (after a prompt). Shift+Delete moves item to trash from a collection. When viewing in My Library, Shift+Delete moves item to trash and skips the prompt.

    I think the behavior inside My Library is a bit confusing due to the inconsistency. IMO, Delete from within My Library should not do anything and Shift+Delete should trigger a prompt and then move item to trash. (though I remember when we were discussing this behavior previously and I may have agreed with current behavior)
  • That explains a lot. I really didn't know why sometimes when I hit the Delete key I got a prompt, and sometimes I didn't. I also didn't understand why I kept running into things that I thought I had deleted--it was because I had used the Delete key when in a Collection.

    Of course, knowing this makes deleting things from a Collection easier. Previously I had been right-clicking and choosing Remove Item from Collection.
Sign In or Register to comment.