||FilePath -> FilePath -> IO ()
renameFile old new changes the name of an existing file system object from old to new. If the new object already exists, it is atomically
replaced by the old object. Neither path may refer to an existing directory. A conformant implementation need not support
renaming files in all situations (for instance, renaming across different physical devices), but the constraints must be documented.
main = do hdl <- openFile "/tmp/foo.txt" WriteMode
hPutStr hdl "HELLO"
a <- doesFileExist "/tmp/foo.txt"
renameFile "/tmp/foo.txt" "/tmp/bar.txt"
b <- doesFileExist "/tmp/foo.txt"
c <- doesFileExist "/tmp/bar.txt"