|
Filesys::Ext2 - Interface to ext2 and ext3 filesystem attributes
|
Filesys::Ext2 - Interface to ext2 and ext3 filesystem attributes
use Filesys::Ext2 qw(:all);
eval { $mode = lsattr("/etc/passwd"); }
eval { chattr("+aud", "/etc/passwd"); }
#or equivalently
#chattr($mode|0x0062, "/etc/passwd");
You may specify the path of the e2fsprogs upon use
use Filesys::Ext2 {PATH=>'/path/to/binaries'};
Otherwise the module will use the default path /usr/bin/
- chattr($mask, @files)
-
Change the mode of @files to match $mask.
$mask may be a bitmask or symbolic mode eg;
=DIE
+cad
-s-i
Throws an exception upon failure.
- lsattr(@files)
-
Returns bitmasks respresenting the attributes of @files.
Throws an exception upon failure.
- lstat($file)
-
Same as
CORE::lstat, but appends the numerical attribute bitmask.
- stat($file)
-
Same as
CORE::stat, but appends the numerical attribute bitmask.
- calcSymMask($mask)
-
Accepts a bitmask and returns the symbolic mode.
In list context it returns a symbol list like lsattr,
in scalar context it returns a string that matches the
- region of lsattr(1) eg;
s-----A------
chattr(1), lsattr(1)
Ideally this would be implemented with XS, maybe someday.
The bit mappings for attributes, from other/ext2_fs.h
- x00000001 == s
Secure deletion
- x00000002 == u
Undelete
- x00000004 == c
Compress file
- x00000008 == S
Synchronous updates
- x00000010 == i
Immutable file
- x00000020 == a
Writes to file may only append
- x00000040 == d
Do not dump file
- x00000080 == A
Do not update atime
- x00000100 == Z
Dirty compressed data
Not user modifiable.
- x00000400 == X
Access raw compressed data
Not (currently) user modifiable.
- x00000800 == E
Compression error.
Not user modifiable.
- x00001000 == I
btree format dir / hash-indexed directory
Not user modifiable.
- x00004000 == j
File data should be journaed
- x00008000 == t
File tail should not be merged
- x00010000 == D
Synchronous directory modifications
- x00020000 == T
Top of directory hierarchies
Jerrad Pierce <jpierce@cpan.org>
|
Filesys::Ext2 - Interface to ext2 and ext3 filesystem attributes
|