Module FileUtil.Mode

Permission symbolic mode.

type who = [
| `User
| `Group
| `Other
| `All
]
type wholist = [
| who
| `List of who list
]
type permcopy = [
| `User
| `Group
| `Other
]
type perm = [
| `Read
| `Write
| `Exec
| `ExecX
| `Sticky
| `StickyO
]
type permlist = [
| perm
| `List of perm list
]
type actionarg = [
| permlist
| permcopy
]
type action = [
| `Set of actionarg
| `Add of actionarg
| `Remove of actionarg
]
type actionlist = [
| action
| `List of action list
]
type clause = [
| `User of actionlist
| `Group of actionlist
| `Other of actionlist
| `All of actionlist
| `None of actionlist
]
type t = clause list

Typical symbolic mode:

  • g+r -> `Group (`Add `Read)
  • u=rw,g+rw,o-rwx -> `User (`Set (`List [`Read; `Write])); `Group (`Add (`List [`Read; `Write])); `Other (`Remove (`List [`Read; `Write; `Exec]))
val to_string : t -> string
val apply : is_dir:bool -> umask:int -> Unix.file_perm -> t -> Unix.file_perm