14 lines
307 B
Haskell
14 lines
307 B
Haskell
|
module Server.Util where
|
||
|
|
||
|
import Control.Exception
|
||
|
|
||
|
import System.Directory
|
||
|
|
||
|
import System.IO.Error
|
||
|
|
||
|
removeIfExists :: FilePath -> IO ()
|
||
|
removeIfExists fileName = removeFile fileName `catch` handleExists
|
||
|
where handleExists e
|
||
|
| isDoesNotExistError e = return ()
|
||
|
| otherwise = throwIO e
|