sandreas / m4b-tool

m4b-tool is a command line utility to merge, split and chapterize audiobook files such as mp3, ogg, flac, m4a or m4b
MIT License
1.12k stars 78 forks source link

check --output-file is writeable before doing a processing job #254

Open jasonblewis opened 4 months ago

jasonblewis commented 4 months ago

Recently I was trying to diagnose an issue with the output file not being writable. It was frustrating that m4b-tool would spend ages doing the conversion then everything is lost right at the end when it turns out the destination is not writeable.

Please consider adding a check to ensure file is writable before starting the whole process and warn the user or abort the job if it is not.

sandreas commented 4 months ago

This is a good suggestion, I'll try to implement this. However, it's not as easy as it sounds, because the output file name is dynamic / replaceable with variables. Some of them may partly depend on the encoded files, but I'll try what I can do.