Deleting/removing item should remove/ask to remove any attachments

Is it possible when deleting an item to have any associated attachments to be removed as well? Removing an item requires to move that item into trash first and then delete it but the attachments still remain in the directory structure on my disk. Any ways to resolve this issue or somehow fix it since it leads to wasted space and redundancy of files which are not any more necessary.
  • Attached files do get deleted once you empty the Zotero trash.

    Zotero won't delete linked files and probably shouldn't.
  • Does the icon of a pdf with a chain on top indicate a linked file?

    "Zotero won't delete linked files and probably shouldn't"

    Why is that necessarily bad if the user wants to remove an item and everything associated with it. Especially when you explicitly move everything into the trash and then empty the trash?

    Is there any other way that it can be achieved via a third party plugin, zotfile or sth?
  • Yes, the chain icon indicates a link -- it's bad because a link, by its nature, indicates that the file sits outside of Zotero and may, e.g., plausibly be used by other applications.

    If you wanted Zotero to handle your files, you'd store them as attachments, i.e. in Zotero's data folder.
  • edited November 5, 2019
    I use a different storage system but it seems to me as something that should be added, as I mentioned especially when you are emptying the trash folder, it could simply ask the user do you want to remove any associated files (if the true reason behind not having this feature is simply out of protection of the user). I haven't come across any other application where the concept of emptying the trash is perceived as while the contents are in location x we'll do it otherwise not. That doesn't resonate with me, you should start giving users more freedom and not more restrictions. The best software is the one that is malleable to the users needs not the other way around.
  • I haven't come across any other application where the concept of emptying the trash is perceived as while the contents are in location x we'll do it otherwise not.
    You're simply mistaken here. If you create a link or alias on any OS and delete it and empty the trash, only the link is deleted, not the original file.

    While that doesn't mean there couldn't be some way to do this, the current behavior is absolutely the correct default and in line with how links work elsewhere. We'd want to think carefully before even adding the ability to have Zotero start deleting files outside of its own data directory, which is fundamentally pretty dangerous and error-prone.
  • You're simply mistaken here. If you create a link or alias on any OS and delete it and empty the trash, only the link is deleted, not the original file.
    I think that depends on whether that's a soft or had link.
    While that doesn't mean there couldn't be some way to do this
    So what are those alternative ways to achieve this?
  • I think that depends on whether that's a soft or had link.
    Hard links don't appear as links, so it's not even relevant, but that's still incorrect. When you delete a hard link, you delete that reference to the file, not any others.
  • That phrase says it could conceivably be implemented, not that it exists already.

    (And no, deleting a softlink or a hardlink or a symlink does not delete the original file)
  • edited November 5, 2019
    (And no, deleting a softlink or a hardlink or a symlink does not delete the original file).
    I don't know how zotero works internally but the fact is that zotero knows where the files live, for instance the right click "show file" option brings me exactly where the file resides, so removing it should be an easy task given that zotero already has the real path to the file.
  • Again, we're not disputing that it would be possible on a technical level. We're just saying that it's in no way the norm as you asserted.
  • Probably the strongest argument for such an option, somewhere, is that we now have a similar option, off by default, to rename linked files based on parent metadata, similar to the default behavior for stored files.
  • Indeed, I'm already using this option so that all linked files are renamed according to a specific pattern (which is a good option to have in the first place IMHO).
  • @dstillman Maybe you could consider a second trash function in the item context menu:

    "Move Items to Trash (incl. Linked Files)"
    = "Convert Linked Files to Stored Files" + "Move Items to Trash"
  • I think a good solution would be to just allow "Convert Linked Files to Stored Files" for items in the Trash folder. At the moment it says "You cannot make changes to the currently selected collection."

    The procedure would then be to move items to trash as usual (no need for another option in the context menu). Before emptying the Trash folder, you could review the trashed items and use "Convert Linked Files to Stored Files" if needed.
Sign In or Register to comment.