hsfm-gtk

Safe HaskellSafe
LanguageHaskell2010

HSFM.FileSystem.UtilTypes

Description

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.

Synopsis

Documentation

data FileOperation Source

Data type describing file operations. Useful to build up a list of operations or delay operations.

Constructors

FCopy Copy 
FMove Move 
FDelete [Path Abs] 
FOpen (Path Abs) 
FExecute (Path Abs) [ByteString] 
None 

data Copy Source

Data type describing partial or complete file copy operation.

Constructors

PartialCopy [Path Abs] 
Copy [Path Abs] (Path Abs) 

data Move Source

Data type describing partial or complete file move operation.

Constructors

PartialMove [Path Abs] 
Move [Path Abs] (Path Abs) 

data FCollisonMode Source

Collision modes that describe the behavior in case a file collision happens.

Constructors

Strict

fail if the target already exists

Overwrite 
OverwriteAll 
Skip 
Rename (Path Fn)