Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
System.FS.BlockIO.API
Synopsis
- data HasBlockIO m h = HasBlockIO {
- close :: HasCallStack => m ()
- submitIO :: HasCallStack => Vector (IOOp (PrimState m) h) -> m (Vector IOResult)
- hSetNoCache :: Handle h -> Bool -> m ()
- hAdvise :: Handle h -> FileOffset -> FileOffset -> Advice -> m ()
- hAllocate :: Handle h -> FileOffset -> FileOffset -> m ()
- tryLockFile :: FsPath -> LockMode -> m (Maybe (LockFileHandle m))
- hSynchronise :: Handle h -> m ()
- synchroniseDirectory :: FsPath -> m ()
- createHardLink :: FsPath -> FsPath -> m ()
- data IOCtxParams = IOCtxParams {}
- defaultIOCtxParams :: IOCtxParams
- mkClosedError :: HasCallStack => SomeHasFS m -> String -> FsError
- data IOOp s h
- = IOOpRead !(Handle h) !FileOffset !(MutableByteArray s) !BufferOffset !ByteCount
- | IOOpWrite !(Handle h) !FileOffset !(MutableByteArray s) !BufferOffset !ByteCount
- ioopHandle :: IOOp s h -> Handle h
- ioopFileOffset :: IOOp s h -> FileOffset
- ioopBuffer :: IOOp s h -> MutableByteArray s
- ioopBufferOffset :: IOOp s h -> BufferOffset
- ioopByteCount :: IOOp s h -> ByteCount
- newtype IOResult = IOResult ByteCount
- data Advice
- hAdviseAll :: HasBlockIO m h -> Handle h -> Advice -> m ()
- hDropCacheAll :: HasBlockIO m h -> Handle h -> m ()
- data LockMode
- data FileLockingNotSupported = FileLockingNotSupported
- newtype LockFileHandle m = LockFileHandle {
- hUnlock :: m ()
- synchroniseFile :: MonadThrow m => HasFS m h -> HasBlockIO m h -> FsPath -> m ()
- synchroniseDirectoryRecursive :: MonadThrow m => HasFS m h -> HasBlockIO m h -> FsPath -> m ()
- tryLockFileIO :: HasFS IO HandleIO -> FsPath -> LockMode -> IO (Maybe (LockFileHandle IO))
- createHardLinkIO :: HasFS IO HandleIO -> (FilePath -> FilePath -> IO ()) -> FsPath -> FsPath -> IO ()
- type ByteCount = CSize
- type FileOffset = COff
HasBlockIO
data HasBlockIO m h Source #
Abstract interface for submitting large batches of I/O operations.
Constructors
HasBlockIO | |
Fields
|
Instances
NFData (HasBlockIO m h) Source # | |
Defined in System.FS.BlockIO.API Methods rnf :: HasBlockIO m h -> () # |
data IOCtxParams Source #
Concurrency parameters for initialising a 'HasBlockIO. Can be ignored by serial implementations.
Constructors
IOCtxParams | |
Fields |
Instances
NFData IOCtxParams Source # | |
Defined in System.FS.BlockIO.API Methods rnf :: IOCtxParams -> () # |
mkClosedError :: HasCallStack => SomeHasFS m -> String -> FsError Source #
Constructors
IOOpRead !(Handle h) !FileOffset !(MutableByteArray s) !BufferOffset !ByteCount | |
IOOpWrite !(Handle h) !FileOffset !(MutableByteArray s) !BufferOffset !ByteCount |
ioopHandle :: IOOp s h -> Handle h Source #
ioopFileOffset :: IOOp s h -> FileOffset Source #
ioopBuffer :: IOOp s h -> MutableByteArray s Source #
ioopBufferOffset :: IOOp s h -> BufferOffset Source #
ioopByteCount :: IOOp s h -> ByteCount Source #
Number of read/written bytes.
Instances
Advice
Basically System.Posix.Fcntl.Advice from the unix
package
hAdviseAll :: HasBlockIO m h -> Handle h -> Advice -> m () Source #
hDropCacheAll :: HasBlockIO m h -> Handle h -> m () Source #
Drop the full file referenced by a Handle
from the OS page cache, if
present.
File locks
Indicates a mode in which a file should be locked.
Constructors
SharedLock | |
ExclusiveLock |
data FileLockingNotSupported #
Exception thrown by hLock
on non-Windows platforms that don't support
flock
.
Since: base-4.10.0.0
Constructors
FileLockingNotSupported |
Instances
Exception FileLockingNotSupported | |
Defined in GHC.IO.Handle.Lock.Common | |
Show FileLockingNotSupported | Since: base-4.10.0.0 |
Defined in GHC.IO.Handle.Lock.Common Methods showsPrec :: Int -> FileLockingNotSupported -> ShowS # show :: FileLockingNotSupported -> String # showList :: [FileLockingNotSupported] -> ShowS # |
newtype LockFileHandle m Source #
A handle to a file locked using tryLockFile
.
Constructors
LockFileHandle | |
Fields
|
Storage synchronisation
synchroniseFile :: MonadThrow m => HasFS m h -> HasBlockIO m h -> FsPath -> m () Source #
Synchronise a file and its contents with the storage device.
synchroniseDirectoryRecursive :: MonadThrow m => HasFS m h -> HasBlockIO m h -> FsPath -> m () Source #
Synchronise a directory and recursively its contents with the storage device.
Defaults for the real file system
createHardLinkIO :: HasFS IO HandleIO -> (FilePath -> FilePath -> IO ()) -> FsPath -> FsPath -> IO () Source #
Re-exports
type FileOffset = COff #