Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Util.File

Contents

Description

Do things with files.

Synopsis

# Documentation

Read and decompress a gzipped file.

Write a gzipped file. Try to do so atomically by writing to fn.write first and renaming it.

Like mv, this will refuse to overwrite a file if it isn't writable.

Throw if this file exists but isn't writable.

True if the file doesn't exist, or if it does but is writable.

Like Directory.getDirectoryContents except don't return dotfiles and it prepends the directory.

recursiveRemoveDirectory crashes if the dir doesn't exist, and follows symlinks.

# IO errors

ignoreEnoent :: IO.IO a -> IO.IO (Maybe a) Source #

If op raised ENOENT, return Nothing.

ignoreIOError :: IO.IO a -> IO.IO (Maybe a) Source #

Ignore all IO errors. This is useful when you want to see if a file exists, because some-file/x will not give ENOENT, but ENOTDIR, which is probably isIllegalOperation.

ignoreError :: Exception e => (e -> Bool) -> IO.IO a -> IO.IO (Maybe a) Source #

try specialized to IOError.