diff options
author | gueux <gueux@web> | 2016-06-20 18:49:30 +0000 |
---|---|---|
committer | admin <admin@branchable.com> | 2016-06-20 18:49:30 +0000 |
commit | 11f046f41a3f717b52e1f3a9d404427dd06a403e (patch) | |
tree | 5ee922d5391fd6735e1f3ebaf3c0c08d98feb949 /doc | |
parent | bda9a461fe4e2041d03627b04fd807d9642274bc (diff) |
Added a comment
Diffstat (limited to 'doc')
-rw-r--r-- | doc/forum/use_withUmask_in_a_property/comment_3_5bdd79ed99f2b001d5dfc8a7d0b2c177._comment | 18 |
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 + +"""]] |