shithub: MicroHs

ref: b047dd65e0c62c2c6a8b019715aa5cff6fa39f7f
dir: /lib/System/Directory.hs/

View raw version
module System.Directory(removeFile) where
import Prelude
import Foreign.C.String
import Foreign.Ptr

foreign import ccall "unlink" c_unlink :: CString -> IO Int

removeFile :: FilePath -> IO ()
removeFile fn = do
  r <- withCAString fn c_unlink
  when (r /= 0) $
    error "removeFile failed"