Module File.Mode

Permissions bits.

type t = [
  1. | `IRWXU
  2. | `IRUSR
  3. | `IWUSR
  4. | `IXUSR
  5. | `IRWXG
  6. | `IRGRP
  7. | `IWGRP
  8. | `IXGRP
  9. | `IRWXO
  10. | `IROTH
  11. | `IWOTH
  12. | `IXOTH
  13. | `ISUID
  14. | `ISGID
  15. | `ISVTX
  16. | `IFMT
  17. | `IFREG
  18. | `IFDIR
  19. | `IFBLK
  20. | `IFCHR
  21. | `IFLNK
  22. | `IFIFO
  23. | `NUMERIC of int
]

The bits.

These are accepted by operations such as Luv.File.chmod in lists, e.g.

[`IRUSR; `IWUSR; `IRGRP; `IROTH]

The special constructor `NUMERIC can be used to specify bits directly in octal. The above list is equivalent to:

[`NUMERIC 0o644]

`IFREG is available since Luv 0.5.5.

`IFMT, `IFDIR, `IFBLK, `IFCHR, `IFLNK, `IFIFO are available since Luv 0.5.4.

type numeric

Abstract type for a bit field of permissions bits, i.e., an int in which multiple bits may be set. These bit fields are returned by operations such as Luv.File.stat.

val test : t list -> numeric -> bool

Luv.File.Mode.test mask bits checks whether all the bits in mask are set in bits. For example, if bits contains 0o644, Luv.File.Mode.test [`IRUSR] bits evaluates to true.