How to check file(pdf) write protection?
What is the simplest way to check if file(pdf) got write protection(or not got)?
I am using Ubuntu and not got any solution.
Use a bash script to check if a file is writable. Bash is the default shell under Ubuntu.
Example script from: http://www.cyberciti.biz/faq/unix-linux-shell-scripting-test-if-filewritable/
#!/bin/bash FILE="$1" [ $# -eq 0 ] && exit 1 if [ -w "$FILE" ] then echo "Write permission is granted on $FILE" else echo "Write permission is NOT granted on $FILE" fi
This checks if the file is writable for the current user running the script.