summaryrefslogtreecommitdiff
path: root/doc/forum
diff options
context:
space:
mode:
Diffstat (limited to 'doc/forum')
-rw-r--r--doc/forum/use_withUmask_in_a_property/comment_3_5bdd79ed99f2b001d5dfc8a7d0b2c177._comment18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/forum/use_withUmask_in_a_property/comment_3_5bdd79ed99f2b001d5dfc8a7d0b2c177._comment b/doc/forum/use_withUmask_in_a_property/comment_3_5bdd79ed99f2b001d5dfc8a7d0b2c177._comment
new file mode 100644
index 00000000..3a9f89c2
--- /dev/null
+++ b/doc/forum/use_withUmask_in_a_property/comment_3_5bdd79ed99f2b001d5dfc8a7d0b2c177._comment
@@ -0,0 +1,18 @@
+[[!comment format=mdwn
+ username="gueux"
+ subject="comment 3"
+ date="2016-06-20T18:49:30Z"
+ content="""
+Thanks!
+
+By reading Cmd.hs, I've managed to get this:
+
+ createKey :: FilePath -> Property UnixLike
+ createKey key = property (\"new private key file: \" ++ key) $ liftIO $ withUmask 0o0177 $ withFile key WriteMode $ \h ->
+ cmdResult <$> boolSystem' \"openssl\" [Param \"genrsa\", Param \"4096\"] (\p -> p { std_out = UseHandle h })
+
+ cmdResult :: Bool -> Result
+ cmdResult False = FailedChange
+ cmdResult True = NoChange
+
+"""]]