hitSSQ :: String -> [Int] -> IO () hitSSQ no hitNum = do let newNum = unwords $ [no] ++ map (\n -> show n) hitNum hitNums <- fmap lines $ readFile "test.txt" writeFile "test.txt" $ unlines $ hitNums ++ [newNum]
*** Exception: test.txt: openFile: resource busy (file is locked) Sincerely! ----- e^(π⋅i) + 1 = 0 -- View this message in context: http://old.nabble.com/After-%60readFile%60%2C-why-cannot-i-%60writeFile%60----tp28793133p28793133.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe