Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Provides functionality for moving a file to a trash location.
Synopsis
- delete :: forall env m. (HasBackend env, HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadFileWriter m, MonadIORef m, MonadLoggerNS m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadReader env m, MonadTerminal m, MonadTime m) => UniqueSeqNE (PathI TrashEntryOriginalPath) -> m ()
- permDelete :: forall env m. (HasBackend env, HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadFileWriter m, MonadHandleWriter m, MonadIORef m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadLoggerNS m, MonadReader env m, MonadTerminal m, MonadTime m) => Bool -> UniqueSeqNE (PathI TrashEntryFileName) -> m ()
- emptyTrash :: forall m env. (HasBackend env, HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadHandleWriter m, MonadLoggerNS m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadReader env m, MonadTerminal m) => Bool -> m ()
- restore :: forall env m. (HasBackend env, HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadFileWriter m, MonadIORef m, MonadLoggerNS m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadReader env m, MonadTerminal m, MonadTime m) => UniqueSeqNE (PathI TrashEntryFileName) -> m ()
- getIndex :: forall env m. (HasBackend env, HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadLoggerNS m, MonadPathReader m, MonadPosixCompat m, MonadReader env m, MonadTerminal m) => m Index
- getMetadata :: forall m env. (HasBackend env, HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadLoggerNS m, MonadPathReader m, MonadPosixCompat m, MonadReader env m, MonadTerminal m) => m Metadata
- convert :: (HasBackend env, HasCallStack, HasTrashHome env, MonadAsync m, MonadFileReader m, MonadFileWriter m, MonadIORef m, MonadLoggerNS m, MonadMask m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadReader env m, MonadTerminal m, MonadTime m) => Backend -> m ()
- merge :: (HasBackend env, HasCallStack, HasTrashHome env, MonadFileReader m, MonadFileWriter m, MonadIORef m, MonadLoggerNS m, MonadMask m, MonadPathReader m, MonadPathWriter m, MonadReader env m, MonadTerminal m, MonadTime m) => PathI TrashHome -> m ()
Delete
delete :: forall env m. (HasBackend env, HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadFileWriter m, MonadIORef m, MonadLoggerNS m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadReader env m, MonadTerminal m, MonadTime m) => UniqueSeqNE (PathI TrashEntryOriginalPath) -> m () Source #
delete trash p
moves path p
to the given trash location trash
and
writes an entry in the trash index. If the trash location is not given,
defaults to XDG data e.g. ~/.localsharecharon/
.
permDelete :: forall env m. (HasBackend env, HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadFileWriter m, MonadHandleWriter m, MonadIORef m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadLoggerNS m, MonadReader env m, MonadTerminal m, MonadTime m) => Bool -> UniqueSeqNE (PathI TrashEntryFileName) -> m () Source #
Permanently deletes the paths from the trash.
emptyTrash :: forall m env. (HasBackend env, HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadHandleWriter m, MonadLoggerNS m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadReader env m, MonadTerminal m) => Bool -> m () Source #
Empties the trash.
Restore
restore :: forall env m. (HasBackend env, HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadFileWriter m, MonadIORef m, MonadLoggerNS m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadReader env m, MonadTerminal m, MonadTime m) => UniqueSeqNE (PathI TrashEntryFileName) -> m () Source #
restore trash p
restores the trashed path <trash>/p
to its original
location.
Information
getIndex :: forall env m. (HasBackend env, HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadLoggerNS m, MonadPathReader m, MonadPosixCompat m, MonadReader env m, MonadTerminal m) => m Index Source #
Reads the index at either the specified or default location. If the file does not exist, returns empty.
getMetadata :: forall m env. (HasBackend env, HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadLoggerNS m, MonadPathReader m, MonadPosixCompat m, MonadReader env m, MonadTerminal m) => m Metadata Source #
Retrieves metadata for the trash directory.
Transformations
convert :: (HasBackend env, HasCallStack, HasTrashHome env, MonadAsync m, MonadFileReader m, MonadFileWriter m, MonadIORef m, MonadLoggerNS m, MonadMask m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadReader env m, MonadTerminal m, MonadTime m) => Backend -> m () Source #
merge :: (HasBackend env, HasCallStack, HasTrashHome env, MonadFileReader m, MonadFileWriter m, MonadIORef m, MonadLoggerNS m, MonadMask m, MonadPathReader m, MonadPathWriter m, MonadReader env m, MonadTerminal m, MonadTime m) => PathI TrashHome -> m () Source #