From 11f046f41a3f717b52e1f3a9d404427dd06a403e Mon Sep 17 00:00:00 2001 From: gueux Date: Mon, 20 Jun 2016 18:49:30 +0000 Subject: Added a comment --- ...comment_3_5bdd79ed99f2b001d5dfc8a7d0b2c177._comment | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 doc/forum/use_withUmask_in_a_property/comment_3_5bdd79ed99f2b001d5dfc8a7d0b2c177._comment (limited to 'doc/forum/use_withUmask_in_a_property') 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 + +"""]] -- cgit v1.2.3