htacg/tidy-html5

read-only file error handling

sharethewisdom opened this issue · 0 comments

I tried to run "tidy -e" on a read-only file, because I wasn't sure if it would be written to.

$ chmod a-w index.html
$ stat -c '%A' index.html
-r--r--r--
$ tidy -q -e index.html  
Document: "index.html" is not a file!
$ echo $?
0
$ tidy --version       
HTML Tidy for Linux version 5.6.0

Why could Tidy not process this file? Could Tidy handle the error better? A message that it could not write to the file, with an appropriate exit code, for example.