Block file writing (or deleting)

Started by dd-b, September 03, 2021, 11:37:53 PM

Previous topic - Next topic

dd-b

I see the --dry-run idea has been pretty much shot down. But what about something a little different -- I could use an option that treated any attempt to write to files as an error. Seems like this might be easier to implement than dry run (one doesn't have to skate around the actual change and then keep going and have everything still work; you can just throw an error and be done when there's a write attempt).

Use case -- when attempting to get things to display the way I want I end up trying things over and over and over. And I'm always just a little afraid that a minor typo, or a misunderstanding about an option, might turn my command into a write (the syntax to query a tag and to write a tag aren't as far apart as might feel safe). If I could put "-do-not-ever-change-a-file-no-matter-what" at the start of my command line I'd feel a little safer.  (Okay, probably a shorter name would be better.)

Another use case is when I'm including an external file, especially in a windows desktop shortcut. I'd kind of like to set in the shortcut an option to prevent any writing on the shortcuts that I'm intending to use just to read information. That way any changes to the files of command-line options they include still can't turn them into writers.

Not that I wouldn't love --dry-run (and that would also serve for this case), but I see how that could be really quite messy to try to add to a program of this complexity. Even if Phil's time were mine to dispose of (which it is not), that might not be even my own preference for how to use it.

Phil Harvey

If you make a mistake and write the file by accident, then the _original file will still exist (unless you explicitly specified -overwrite_original), and may be easily recovered.  It may be a bit harder to find the file if the FileName and/or Directory tags are written, but in this case the console output will give you information about how the files were moved/renamed.  So I don't see a real need for an option to block writing.  I would need a good reason to add another option since the documentation is already too long for the average person to wade through.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

RKaji

Please tell me, if in this situation the original file is not saved, there is no way to restore it?