Node.FS.Perms
- Package
- purescript-node-fs
- Repository
- purescript-node/purescript-node-fs
#Perm Source
newtype PermA Perm value specifies what is allowed to be done with a particular
file by a particular class of user — that is, whether it is
readable, writable, and/or executable. It has a Semiring instance, which
allows you to combine permissions:
(+)addsPermvalues together. For example,read + writemeans "readable and writable".(*)masks permissions. It can be thought of as selecting only the permissions that twoPermvalues have in common. For example:(read + write) * (write + execute) == write.
You can think also of a Perm value as a subset of the set
{ read, write, execute }; then, (+) and (*) represent set union and
intersection respectively.
Instances
#permsFromString Source
permsFromString :: String -> Maybe PermsAttempt to parse a Perms value from a String containing an octal
integer. For example,
permsFromString "0644" == Just (mkPerms (read + write) read read).
#permsToString Source
permsToString :: Perms -> StringConvert a Perms value to an octal string, in a format similar to that
accepted by chmod. For example:
permsToString (mkPerms (read + write) read read) == "0644"
#permsToInt Source
permsToInt :: Perms -> IntConvert a Perms value to an Int, via permsToString.