[[!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 """]]