Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
This module provides high-level IO related file operations like copy, delete, move and so on. It only operates on `Path Abs` which guarantees us well-typed paths which are absolute.
Some functions are just path-safe wrappers around
unix functions, others have stricter exception handling
and some implement functionality that doesn't have a unix
counterpart (like copyDirRecursive
).
Some of these operations are due to their nature not _atomic_, which means they may do multiple syscalls which form one context. Some of them also have to examine the filetypes explicitly before the syscalls, so a reasonable decision can be made. That means the result is undefined if another process changes that context while the non-atomic operation is still happening. However, where possible, as few syscalls as possible are used and the underlying exception handling is kept.
- data FileOperation
- data Copy
- = PartialCopy [Path Abs]
- | Copy [Path Abs] (Path Abs)
- data Move
- = PartialMove [Path Abs]
- | Move [Path Abs] (Path Abs)
- data FCollisonMode
- = Strict
- | Overwrite
- | OverwriteAll
- | Skip
- | Rename (Path Fn)
Documentation
data FileOperation Source #
Data type describing file operations. Useful to build up a list of operations or delay operations.
Data type describing partial or complete file copy operation.
PartialCopy [Path Abs] | |
Copy [Path Abs] (Path Abs) |
Data type describing partial or complete file move operation.
PartialMove [Path Abs] | |
Move [Path Abs] (Path Abs) |
data FCollisonMode Source #
Collision modes that describe the behavior in case a file collision happens.
Strict | fail if the target already exists |
Overwrite | |
OverwriteAll | |
Skip | |
Rename (Path Fn) |