2 module Main (main) where
4 import Control.Exception
6 import System.Directory
9 -- like copyFile001, but moves a file in the current directory
12 main = do d <- getCurrentDirectory
13 flip finally (setCurrentDirectory d) $ do
14 setCurrentDirectory "copyFile"
16 cs_before <- getDirectoryContents "."
18 print $ sort cs_before
20 cs_before <- getDirectoryContents "."
22 print $ sort cs_before
25 tryIO :: IO a -> IO (Either IOException a)