Module Statx.Attr

include FLAGS
type t = private int

A set of flags.

val empty : t
val of_int : int -> t

of_int i is the flags whose bits are those set in i.

val to_int : t -> int

to_int t is the integer with the bits of the flags t set.

val (+) : t -> t -> t

a + b is the union of the sets.

val mem : t -> t -> bool

mem x flags is true iff x is a subset of flags.

val (=) : t -> t -> bool

a = b is true iff a and b are the same set of flags.

val compressed : t

The file is compressed by the filesystem.

val immutable : t

The file cannot be modified, as defined by chattr(1).

val append : t

The file can only be opened in append mode for writing. See chattr(1).

val nodump : t

The file is not a candidate for backup when a backup program scans the filesystem.

val encrypted : t

A key is required for the file to be encrypted by the filesystem.

val verity : t

The file has fs-verity enabled. It cannot be written to, and all reads from it will be verified against a cryptographic hash that covers the entire file.

val dax : t

The file is in the DAX (cpu direct access) state, which minimises page-cache effects for both I/O and memory mappings of this file.

  • since Linux 5.8
val mem_checked : mask:t -> t -> t -> bool

mem_checked ~mask attr attrs is true iff attr is both supported and set, i.e. mem attr mask && mem attr attrs.

attrs should be the result of attributes and mask that of attributes_mask for the same statx reply. The kernel leaves unsupported attributes in an undefined state, so an attribute that is not in mask is reported as unset.

If you have already established that an attribute is supported you can use mem directly.