lsm-tree-1.1.1.0: Log-structured merge-trees
Safe HaskellSafe-Inferred
LanguageGHC2021

Database.LSMTree.Internal.FS

Description

Common file system operations

Synopsis

Hard links

hardLink Source #

Arguments

:: (HasCallStack, MonadMask m, PrimMonad m) 
=> ActionRegistry m 
-> HasFS m h

The file system

-> HasBlockIO m h'

The file system

-> FsPath

The path to the source file

-> FsPath

The path to the destination file

-> m () 

Create a hard link for a source file at a destination file /on the same file system/.

If the source path and destination path are not on the same disk volume, an FsError with an EXDEV error number will be thrown.

hardLinkDirectoryRec Source #

Arguments

:: (HasCallStack, MonadMask m, PrimMonad m) 
=> ActionRegistry m 
-> HasFS m h

The file system

-> HasBlockIO m h'

The file system

-> FsPath

The path to the source directory

-> FsPath

The path to the destination directory

-> m () 

Recursively create hard links for a source directory and its contents at a destination directory on the same file system.

If the source path and destination path (or recursively their directory contents) are not on the same disk volume, an FsError with an EXDEV error number will be thrown.

Copy files and directories

copyFile' Source #

Arguments

:: (HasCallStack, MonadMask m, PrimMonad m) 
=> ActionRegistry m 
-> HasFS m h

The file system

-> FsPath

The path to the source file

-> FsPath

The path to the destination file

-> m () 

Copy a source file to a destination file on the same file system.

copyFile Source #

Arguments

:: (HasCallStack, MonadMask m, PrimMonad m) 
=> ActionRegistry m 
-> HasFS m h

The source file system

-> FsPath

The path to the source file with respect to the source fileystem

-> HasFS m h'

The destination file system

-> FsPath

The path to the destination file with respect to the destination fileystem

-> m () 

Copy a source file to a destination file /on potentially different file systems/.

copyDirectoryRec Source #

Arguments

:: (HasCallStack, MonadMask m, PrimMonad m) 
=> ActionRegistry m 
-> HasFS m h 
-> FsPath

The path to the source directory with respect to the source fileystem

-> HasFS m h'

The destination file system

-> FsPath

The path to the destination directory with respect to the destination fileystem

-> m () 

Recursively copy a source directory and its contents to a destination directory on potentially different file systems

copyDirectoryRec' Source #

Arguments

:: (HasCallStack, MonadMask m, PrimMonad m) 
=> ActionRegistry m 
-> HasFS m h 
-> FsPath

The path to the source directory

-> FsPath

The path to the destination directory

-> m () 

Recursively copy a source directory and its contents to a destination directory on the same file system.

Hard links with copy fallback

hardLinkOrCopyDirectoryRec Source #

Arguments

:: (HasCallStack, MonadMask m, PrimMonad m) 
=> ActionRegistry m 
-> HasFS m h

The file system

-> HasBlockIO m h'

The file system

-> FsPath

The path to the source directory

-> FsPath

The path to the destination directory

-> m () 

Attempt to use hardLinkDirectoryRec, and if that fails because the source and destination directory are not on the same disk volume, use copyDirectoryRec' instead.