let permission_of_int pr =
let perm_match oct =
(pr land oct) <> 0
in
{
user =
{
sticky = perm_match 0o4000;
exec = perm_match 0o0100;
write = perm_match 0o0200;
read = perm_match 0o0400;
};
group =
{
sticky = perm_match 0o2000;
exec = perm_match 0o0010;
write = perm_match 0o0020;
read = perm_match 0o0040;
};
other =
{
sticky = perm_match 0o1000;
exec = perm_match 0o0001;
write = perm_match 0o0002;
read = perm_match 0o0004;
};
}