multicast: New command, uses uftp to multicast annexed files, for eg a classroom setting.

This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
Joey Hess 2017-03-30 19:32:58 -04:00
parent 39e8433d46
commit c3970f6c1a
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
13 changed files with 454 additions and 2 deletions

View file

@ -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