charon-0.1: Template
Safe HaskellSafe-Inferred
LanguageGHC2021

Charon

Description

Provides functionality for moving a file to a trash location.

Synopsis

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/.

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