summaryrefslogtreecommitdiff
path: root/cokiki.hs
diff options
context:
space:
mode:
Diffstat (limited to 'cokiki.hs')
-rw-r--r--cokiki.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/cokiki.hs b/cokiki.hs
index 26748b2..9448aea 100644
--- a/cokiki.hs
+++ b/cokiki.hs
@@ -10,6 +10,7 @@ import qualified Data.ByteString.Lazy.Char8 as L
10import qualified Data.ByteString.Lazy.Char8 as L8 10import qualified Data.ByteString.Lazy.Char8 as L8
11import qualified Kiki 11import qualified Kiki
12import System.Directory 12import System.Directory
13import System.FilePath.Posix (takeDirectory)
13import System.Environment 14import System.Environment
14import System.IO 15import System.IO
15import System.Posix.User 16import System.Posix.User
@@ -63,6 +64,7 @@ maybeReadFile :: FilePath -> IO (Maybe L.ByteString)
63maybeReadFile path = do 64maybeReadFile path = do
64 doesFileExist path >>= bool (return Nothing) (Just <$> L.readFile path) 65 doesFileExist path >>= bool (return Nothing) (Just <$> L.readFile path)
65myWriteFile f bs = do 66myWriteFile f bs = do
67 createDirectoryIfMissing True (takeDirectory f)
66 hPutStrLn stderr $ "Writing "++f 68 hPutStrLn stderr $ "Writing "++f
67 -- L8.putStr bs 69 -- L8.putStr bs
68 L8.writeFile f bs 70 L8.writeFile f bs