Skip to content

E2 immutable command-line single-program library

Latest
Compare
Choose a tag to compare
@duangsuse duangsuse released this 30 Jul 04:32
· 2 commits to master since this release
// Author: duangsuse
// Utility for changing file "Immutable" attribute and reading file "Append"
// "Immutable" attribute
// Language: C99 / C++ 11
// Created: Jul, 2018 License: GPLv2

// Usage: e2immutable (+/-/@) <file path>
// @: query file attr
//   return 0: no attribute
//   return 255: stat/cmdline fails
//   return 254: fgetfattr fails
//   return 1: +i
//   return 2: +a
//   return 3: +i +a
// +: add immutable attribute
//   return 0: OK, changed
//   return 1: OK, unchanged
//   return 255: stat/cmdline fails
//   return 254: fsetfattr fails
// -: remove immutable attribute
//   return 0: OK, changed
//   return 1: OK, unchanged
//   return 255: stat/cmdline fails
//   return 254: fsetfattr fails