diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-03-30 19:32:58 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-03-30 19:35:30 -0400 |
commit | f1a6e00a3107317d551c27459194aff3317919f4 (patch) | |
tree | 7ec2a98fd4a4ad0308792c8bb4c52ece424c43d0 /Utility | |
parent | 0862a7f3a3823a925f86bf2c33d67db05a2781e8 (diff) |
multicast: New command, uses uftp to multicast annexed files, for eg a classroom setting.
This commit was supported by the NSF-funded DataLad project.
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/FileMode.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Utility/FileMode.hs b/Utility/FileMode.hs index fe9cbf56a..d9a269448 100644 --- a/Utility/FileMode.hs +++ b/Utility/FileMode.hs @@ -177,7 +177,10 @@ writeFileProtected file content = writeFileProtected' file (\h -> hPutStr h content) writeFileProtected' :: FilePath -> (Handle -> IO ()) -> IO () -writeFileProtected' file writer = withUmask 0o0077 $ +writeFileProtected' file writer = protectedOutput $ withFile file WriteMode $ \h -> do void $ tryIO $ modifyFileMode file $ removeModes otherGroupModes writer h + +protectedOutput :: IO a -> IO a +protectedOutput = withUmask 0o0077 |