Quote:
Originally Posted by falsifier
Why are you even thinking I'm editing read-only files? Of course I don't edit them. But I do open and keep them open so I can quickly consult them while indeed editing other ones.
|
That's what a viewer is for. If you open it in an editor, calibre assumes, rightly, that you want to EDIT the file.
Quote:
I make them write-protected on purpose, to make sure they stay unchanged, because I open them in an editor after all, and s#%t happens. You make a mistake and edit wrong file, and then too quickly click those “Save” and “Close” buttons, giving yourself no chance to revert the changes. Or your cat steps on the ‘Delete’ key on your keyboard while you went to the loo and you don't notice when you're back. You do know Murphy's law, don't you? That read-only file attribute is supposed to protect you from such things, so it's just not right to silently ignore/remove that protection and overwrite files without owner's knowledge and approval…
|
Yes, sure, and cosmic rays can hit your harddrive and edit your read only file as well. Maybe you should engrave them on stone tablets to make sure they arent accidentally edited. But then the ghost of Ozymandias could show up and edit that as well. Hmm a conundrum.
Quote:
Here's a patch for the problem Lomkiri originally reported. With this applied, if the original file is write-protected, ‘Save’ will fail with the ‘Could not save’ error message, but ‘Save a copy’ will succeed. I think it works OK but I only tested it with epubs, and I'm not a proper Python programmer, so someone better verify it.
|
Your patch is insufficient. Read what I said. This change was deliberate to prevent people from losing editing work if they happen to accidentally open a read only file, you know if their cat steps on the keyboard and makes the file read only.
So you need to *warn* the user and allow the user to override, not fail to save, if you want your patch accepted.