diff options
author | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-08-02 18:04:00 +0200 |
---|---|---|
committer | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-08-02 18:04:00 +0200 |
commit | d45cdc8cf9e118e5225c475e569db43bf13064de (patch) | |
tree | b569b0808897fcbc04f9cf6e293fb62293a7dd4c | |
parent | 5eb1694a37c295e848bdd93dbe5a8f3b2eb8cdc2 (diff) | |
download | trivmix-d45cdc8cf9e118e5225c475e569db43bf13064de.tar trivmix-d45cdc8cf9e118e5225c475e569db43bf13064de.tar.gz trivmix-d45cdc8cf9e118e5225c475e569db43bf13064de.tar.bz2 trivmix-d45cdc8cf9e118e5225c475e569db43bf13064de.tar.xz trivmix-d45cdc8cf9e118e5225c475e569db43bf13064de.zip |
attempt to fix file modes
-rw-r--r-- | trivmix/Trivmix.hs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/trivmix/Trivmix.hs b/trivmix/Trivmix.hs index f7c1b48..a0c974c 100644 --- a/trivmix/Trivmix.hs +++ b/trivmix/Trivmix.hs | |||
@@ -89,18 +89,18 @@ initialLevel = def | |||
89 | 89 | ||
90 | defFileMode :: FileMode | 90 | defFileMode :: FileMode |
91 | defFileMode = foldl unionFileModes nullFileMode [ ownerReadMode | 91 | defFileMode = foldl unionFileModes nullFileMode [ ownerReadMode |
92 | , ownerWriteMode | 92 | , ownerWriteMode |
93 | , groupReadMode | 93 | , groupReadMode |
94 | , groupWriteMode | 94 | , groupWriteMode |
95 | , otherReadMode | 95 | , otherReadMode |
96 | ] | 96 | ] |
97 | 97 | ||
98 | defDirectoryMode :: FileMode | 98 | defDirectoryMode :: FileMode |
99 | defDirectoryMode = foldl unionFileModes nullFileMode [ ownerModes | 99 | defDirectoryMode = foldl unionFileModes nullFileMode [ ownerModes |
100 | , groupModes | 100 | , groupModes |
101 | , otherReadMode | 101 | , otherReadMode |
102 | , otherExecuteMode | 102 | , otherExecuteMode |
103 | ] | 103 | ] |
104 | main :: IO () | 104 | main :: IO () |
105 | main = execParser opts >>= trivmix | 105 | main = execParser opts >>= trivmix |
106 | where | 106 | where |
@@ -166,6 +166,7 @@ onStateFile file initial action = do | |||
166 | directories = iterate takeDirectory directory | 166 | directories = iterate takeDirectory directory |
167 | createDirs <- takeWhileM (\d -> not <$> doesDirectoryExist d) directories | 167 | createDirs <- takeWhileM (\d -> not <$> doesDirectoryExist d) directories |
168 | exists <- doesFileExist file | 168 | exists <- doesFileExist file |
169 | setFileCreationMask nullFileMode | ||
169 | let acquireFile = case exists of | 170 | let acquireFile = case exists of |
170 | True -> return () | 171 | True -> return () |
171 | False -> do | 172 | False -> do |