summaryrefslogtreecommitdiff
path: root/Utility/FileMode.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Utility/FileMode.hs')
-rw-r--r--Utility/FileMode.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Utility/FileMode.hs b/Utility/FileMode.hs
index d76fb5703..1307d3842 100644
--- a/Utility/FileMode.hs
+++ b/Utility/FileMode.hs
@@ -65,12 +65,15 @@ allowWrite :: FilePath -> IO ()
allowWrite f = modifyFileMode f $ addModes [ownerWriteMode]
{- Allows owner and group to read and write to a file. -}
-groupWriteRead :: FilePath -> IO ()
-groupWriteRead f = modifyFileMode f $ addModes
+groupSharedModes :: [FileMode]
+groupSharedModes =
[ ownerWriteMode, groupWriteMode
, ownerReadMode, groupReadMode
]
+groupWriteRead :: FilePath -> IO ()
+groupWriteRead f = modifyFileMode f $ addModes groupSharedModes
+
checkMode :: FileMode -> FileMode -> Bool
checkMode checkfor mode = checkfor `intersectFileModes` mode == checkfor