get_e2attrs


Description:

[ Version ( since = "1.17.31" ) ]
public string get_e2attrs (string file) throws Error

get ext2 file attributes of a file

This returns the file attributes associated with file.

The attributes are a set of bits associated with each inode which affect the behaviour of the file. The attributes are returned as a string of letters (described below). The string may be empty, indicating that no file attributes are set for this file.

These attributes are only present when the file is located on an ext2/3/4 filesystem. Using this call on other filesystem types will result in an error.

The characters (file attributes) in the returned string are currently:

'A' When the file is accessed, its atime is not modified.

'a' The file is append-only.

'c' The file is compressed on-disk.

'D' (Directories only.) Changes to this directory are written synchronously to disk.

'd' The file is not a candidate for backup (see dump(8)).

'E' The file has compression errors.

'e' The file is using extents.

'h' The file is storing its blocks in units of the filesystem blocksize instead of sectors.

'I' (Directories only.) The directory is using hashed trees.

'i' The file is immutable. It cannot be modified, deleted or renamed. No link can be created to this file.

'j' The file is data-journaled.

's' When the file is deleted, all its blocks will be zeroed.

'S' Changes to this file are written synchronously to disk.

'T' (Directories only.) This is a hint to the block allocator that subdirectories contained in this directory should be spread across blocks. If not present, the block allocator will try to group subdirectories together.

't' For a file, this disables tail-merging. (Not used by upstream implementations of ext2.)

'u' When the file is deleted, its blocks will be saved, allowing the file to be undeleted.

'X' The raw contents of the compressed file may be accessed.

'Z' The compressed file is dirty.

More file attributes may be added to this list later. Not all file attributes may be set for all kinds of files. For detailed information, consult the chattr(1) man page.

See also set_e2attrs.

Don't confuse these attributes with extended attributes (see getxattr).

Parameters:

this

A GuestfsSession object

Returns:

the returned string, or NULL on error