Small command-line app for reading 'i/a' attribute and changing file 'immutable' attribute
Attrtools Usage:
./attrtools +i <path> ; Set Immutable
./attrtools -i <path> ; Unset Immutable
./attrtools <path> ; Is Immutable?
- attrtools +i <path> to add 'immutable' flag for file
- attrtools -i <path> to remove 'immutable' flag for file
- attrtools <path> to query file flags
sudo ./attrtools +i libe2.o
File: libe2.o
./attrtools libe2.o
File: libe2.o
16
+i
+a
sudo ./attrtools -i libe2.o
File: libe2.o
sudo ./attrtools +i libe2
Cannot stat: libe2: No such file or directory
./attrtools -i libe2.o
File: libe2.o
Failed to chattr -i: Operation not permitted
Exit 1 if command line/file stat fails
Exit 2 if chattr/lsattr fails
- "informations" are printed to stdout
- "results" are printed to stderr
- "errors" are printed to stderr
Execute this in project dir:
ndk-build NDK_PROJECT_PATH=`pwd` NDK_APPLICATION_MK=./Application.mk