As we proceed with the issues in #1448, and add more features to file entities, it seems like the expectations around how files are cleaned up by the system will change.
Right now, if a file is not currently being used on any piece of content, it is being deleted. That makes sense if the only way to add files is through a node form, and there is no easy way to reuse the file across the site in multiple places. However, as we move to a media library paradigm, where files are available for placement, it seems like people will expect files to stick around in the library even if they are not currently being used.
We should look at providing some site-wide controls for when and whether orphan files are deleted, with the ability to turn off the garbage collection, or set it to a custom amount of time that a file is not used before it is cleaned up.
Recent comments
This was tricky, so i tried to stay minimal and try to snatch the very first procedure after file upload and inject rehashing there. The file is tinymce.pages.inc under the function...
File hashing uploads made through TinyMCE
Bee's great. But if you don't want to install bee, or can't, or you already have a bunch of scripts you're used to using in D7, then the method I posted is quick and easy and all you really...
How to create a command-line (cli) routine or script (bee not required)
Or you can install bee, get the benefit of all the included functions and either include your script using: bee php-script ../my-scripts/scratch.php https://github.com/backdrop-...
How to create a command-line (cli) routine or script (bee not required)