Posix.IO.File.Permission

Permission Record

type alias Permission =
{ ownerRead : Bool
, ownerWrite : Bool
, ownerExecute : Bool
, groupRead : Bool
, groupWrite : Bool
, groupExecute : Bool
, allRead : Bool
, allWrite : Bool
, allExecute : Bool
}
readWrite : Permission

Read and write for everyone. (0o666)

true : Permission

All permission set to True

perm775 =
    { true
        | allWrite = False
    }
false : Permission

All permission set to False

perm600 =
    { false
        | ownerRead = True
        , ownerWrite = True
    }

Permission bitmask

type Mask
= Mask Int

The permission bitmask is wrapped to avoid confusion with a normal Int

Default mask, 0666

toMask : Permission -> Mask

Create a bitmask from a record.

fromMask : Mask -> Permission

Create a record from a bitmask.

fromOctal : Int -> Mask

Construct a bitmask from an "octal" number. This is useful since Elm does not support octal literal notation.

fromOctal 775

fromOctal 664