!$      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~SafeW hpath-directoryReturns True if posix-paths was compiled with support for the provided flag. (As of this writing, the only flag for which this check may be necessary is $; all other flags will always yield True.)hpath-directory O_CLOEXEC0 is not supported on every POSIX platform. Use  oCloexec to determine if support for  O_CLOEXEC@ was compiled into your version of posix-paths. (If not, using oCloexec will throw an exception.)       2016 Julian OspaldBSD3"Julian Ospald <hasufell@posteo.de> experimentalportableSafePWL#hpath-directory*Open and optionally create this file. See $ for information on how to use the FileMode type.Note that passing Just x# as the 4th argument triggers the 1 status flag, which must be set when you pass in 0 to the status flags. Also see the manpage for open(2).#hpath-directorystatus flags of open(2)hpath-directoryJust xJ => creates the file with the given modes, Nothing => the file must exist.## 2016 Julian OspaldBSD3"Julian Ospald <hasufell@posteo.de> experimentalportableNone2WX: *hpath-directoryA type for giving failure hints on recursive failure, which allows to programmatically make choices without examining the weakly typed I/O error attributes (like ioeGetFileName).`The first argument to the data constructor is always the source and the second the destination./hpath-directoryJAdditional generic IO exceptions that the posix functions do not provide.:hpath-directoryThrows  AlreadyExists  if file exists.;hpath-directoryThrows  AlreadyExists  if directory exists.<hpath-directoryUses 3 and throws 0 if it returns True.=hpath-directory^Check if the files are the same by examining device and file id. This follows symbolic links.>hpath-directoryChecks whether the destination directory is contained within the source directory by comparing the device+file ID of the source directory with all device+file IDs of the parent directories of the destination.?hpath-directoryCarries out an action, then checks if there is an IOException and a specific errno. If so, then it carries out another action, otherwise it rethrows the error.@hpath-directoryExecute the given action and retrow IO exceptions as a new Exception that have the given errno. If errno does not match the exception is rethrown as is.Ahpath-directoryLike , with arguments swapped.Chpath-directoryLike , but allows to have different clean-up actions depending on whether the in-between computation has raised an exception or not.>hpath-directory source dirhpath-directoryfull destination,  dirname dest must exist?hpath-directoryerrno to catchhpath-directory-action to try, which can raise an IOExceptionhpath-directoryEaction to carry out in case of an IOException and if errno matches@hpath-directoryerrno to catchhpath-directoryrethrow as if errno matcheshpath-directory action to tryChpath-directorycomputation to run firsthpath-directory8computation to run last, when no exception was raisedhpath-directory8computation to run last, when an exception was raisedhpath-directorycomputation to run in-betweenDhpath-directoryreaction on IO errorshpath-directoryreaction on HPathIOException*+,-./0123456789:;<=>?@ABCD/012*+,-.3456789:;<=>?@ABCD 2016 Julian OspaldBSD3"Julian Ospald <hasufell@posteo.de> experimentalportableNone%PWNuJhpath-directory6Get all files from a directory and its subdirectories.Upon entering a directory, Jy will get all entries strictly. However the returned list is lazy in that directories will only be accessed on demand.)Follows symbolic links for the input dir.Khpath-directory?Get all files from a directory and its subdirectories strictly.)Follows symbolic links for the input dir.Lhpath-directoryRecursively apply the action7 to the parent directory and all files/subdirectories.5This function allows for memory-efficient traversals.)Follows symbolic links for the input dir.Phpath-directory.Gets all directory contents (not recursively).Qhpath-directory Binding to  fdopendir(3).Rhpath-directoryLike P except for a file descriptor.;To avoid complicated error checks, the file descriptor is always closed, even if Q2 fails. Usually, this only happens on successful QD and after the directory stream is closed. Also see the manpage of  fdopendir(3) for more details.Shpath-directory*return the canonicalized absolute pathname like canonicalizePath, but uses  realpath(3) JKLMNOPQRS PRJKLONMQS 2020 Julian OspaldBSD3"Julian Ospald <hasufell@posteo.de> experimentalportableNoneW8($hpath-directoryWChecks whether the directory at the given path exists and can be opened. This invokes  which follows symlinks.%hpath-directory,Checks whether a file or folder is writable.BOnly eACCES, eROFS, eTXTBSY, ePERM are catched (and return False).Throws: if the file does not exist&hpath-directoryNChecks if the given file exists and is a directory. Does not follow symlinks.+Only eNOENT is catched (and returns False).'hpath-directoryRChecks if the given file exists and is not a directory. Does not follow symlinks.+Only eNOENT is catched (and returns False).(hpath-directoryJConverts any path to an absolute path. This is done in the following way:6if the path is already an absolute one, just return it<if it's a relative path, prepend the current directory to it)hpath-directoryApplies realpath on the given path.Throws:- if the file at the given path does not exist if the symlink is brokenThpath-directorysThe mode for copy and file moves. Overwrite mode is usually not very well defined, but is a convenience shortcut.Uhpath-directoryfail if any target existsVhpath-directoryoverwrite targetsWhpath-directory(The error mode for recursive operations.On X the whole operation fails immediately if any of the recursive sub-operations fail, which is sort of the default for IO operations.On Y` skips errors in the recursion and keeps on recursing. However all errors are collected in the 2N error type, which is raised finally if there was any error. Also note that 2K does not give any guarantees on the ordering of the collected exceptions.bhpath-directoryCopies the contents of a directory recursively to the given destination, while preserving permissions. Does not follow symbolic links. This behaves more or less like the following, without descending into the destination if it already exists: ) cp -a /source/dir /destination/somedir DFor directory contents, this will ignore any file type that is not \, ] or [.For V copy mode this does not prune destination directory contents, so the destination might contain more files than the source after the operation has completed. Permissions of existing directories are fixed.Safety/reliability concerns: not atomicexamines filetypes explicitlyan explicit check > is carried out for the top directory for basic sanity, because otherwise we might end up with an infinite copy loop... however, this operation is not carried out recursively (because it's slow)Throws:# if source directory does not exist$ if source directory can't be opened04 if source and destination are the same file (/)1. if destination is contained in source (/) Throws in X RecursiveErrorMode only:$ if output directory is not writable, if source directory is wrong type (symlink)1 if source directory is wrong type (regular file) Throws in Y RecursiveErrorMode only:2e if any of the recursive operations that are not part of the top-directory sanity-checks fail (/) Throws in U CopyMode only: if destination already existsNote: may call getcwd) (only if destination is a relative path)chpath-directoryRecreate a symlink.In V8 copy mode only files and empty directories are deleted.Safety/reliability concerns:V mode is inherently non-atomicThrows:- if source file is wrong type (not a symlink)) if output directory cannot be written to% if source directory cannot be opened04 if source and destination are the same file (/) Throws in U mode only: if destination already exists Throws in V mode only:+ if destination file is non-empty directoryNotes:calls symlinkcalls getcwd6 in Overwrite mode (if destination is a relative path)dhpath-directoryCopies the given regular file to the given destination. Neither follows symbolic links, nor accepts them. For "copying" symbolic links, use c instead.yNote that this is still sort of a low-level function and doesn't examine file types. For a more high-level version, use e instead.In V> copy mode only overwrites actual files, not directories. In U* mode the destination file must not exist.Safety/reliability concerns:V mode is not atomic when used on _], reads the "contents" and copies them to a regular file, which might take indefinitely when used on ^, may either read the "contents" and copy them to a regular file (potentially hanging indefinitely) or may create a regular empty destination file when used on `, will hang indefinitelyThrows: if source file does not exist if source file is a a a$ if output directory is not writable$ if source directory can't be opened4 if source file is wrong type (symlink or directory)04 if source and destination are the same file (/) Throws in U mode only: if destination already existsNotes: may call getcwd6 in Overwrite mode (if destination is a relative path)ehpath-directoryCopies a regular file, directory or symbolic link. In case of a symbolic link it is just recreated, even if it points to a directory. Any other file type is ignored.Safety/reliability concerns:examines filetypes explicitlycalls b for directoriesNote: may call getcwd6 in Overwrite mode (if destination is a relative path)fhpath-directoryDeletes the given file. Raises eISDIR8 if run on a directory. Does not follow symbolic links.Throws: for wrong file type (directory) if the file does not exist if the directory cannot be read Notes: calls unlinkghpath-directoryADeletes the given directory, which must be empty, never symlinks.Throws:+ for wrong file type (symlink to directory)# for wrong file type (regular file) if directory does not exist if directory is not empty. if we can't open or write to parent directory Notes: calls rmdirhhpath-directoryPDeletes the given directory recursively. Does not follow symbolic links. Tries g/ first before attemtping a recursive deletion.(On directory contents this behaves like i1 and thus will ignore any file type that is not \, ] or [.Safety/reliability concerns: not atomicexamines filetypes explicitlyThrows:+ for wrong file type (symlink to directory)# for wrong file type (regular file) if directory does not exist. if we can't open or write to parent directoryihpath-directoryDeletes a file, directory or symlink. In case of directory, performs recursive deletion. In case of a symlink, the symlink file is deleted. Any other file type is ignored.Safety/reliability concerns:examines filetypes explicitlycalls h for directoriesjhpath-directoryeOpens a file appropriately by invoking xdg-open. The file type is not checked. This forks a process.khpath-directoryBExecutes a program with the given arguments. This forks a process.lhpath-directoryMCreate an empty regular file at the given directory with the given filename.Throws:) if output directory cannot be written to if destination already exists? if any of the parent components of the path do not existmhpath-directoryICreate an empty directory at the given directory with the given filename.Throws:) if output directory cannot be written to if destination already exists? if any of the parent components of the path do not existnhpath-directoryICreate an empty directory at the given directory with the given filename.Throws:) if output directory cannot be written to? if any of the parent components of the path do not existohpath-directoryCreate an empty directory at the given directory with the given filename. All parent directories are created with the same filemode. This basically behaves like:  mkdir -p /some/dir Safety/reliability concerns: not atomicThrows:O if any part of the path components do not exist and cannot be written to= if destination already exists and is *not* a directory Note: calls getcwd% if the input path is a relative pathphpath-directoryCreate a symlink.Throws:) if output directory cannot be written to# if destination file already exists? if any of the parent components of the path do not exist Note: calls symlinkqhpath-directorynRename a given file with the provided filename. Destination and source must be on the same device, otherwise  will be raised.CDoes not follow symbolic links, but renames the symbolic link file.Safety/reliability concerns:@has a separate set of exception handling, apart from the syscallThrows: if source file does not exist) if output directory cannot be written to% if source directory cannot be opened: if source and destination are on different devices if destination already exists05 if destination and source are the same file (/) Note: calls 3 (but does not allow to rename over existing files)rhpath-directorydMove a file. This also works across devices by copy-delete fallback. And also works on directories.CDoes not follow symbolic links, but renames the symbolic link file.Safety/reliability concerns:V mode is not atomic-copy-delete fallback is inherently non-atomicsince this function calls e and i as a fallback to q, file types that are not \, ] or [ may be ignoredfor VL mode, the destination will be deleted (not recursively) before movingThrows: if source file does not exist) if output directory cannot be written to% if source directory cannot be opened05 if destination and source are the same file (/) Throws in U mode only: if destination already existsNotes:calls 3 (but does not allow to rename over existing files)calls getcwd4 in Overwrite mode if destination is a relative pathshpath-directoryRead the given file *at once* into memory as a lazy ByteString. Symbolic links are followed, no sanity checks on file size or file type. File must exist. Uses Builders under the hood (hence lazy ByteString).Safety/reliability concerns:<the whole file is read into memory, this doesn't read lazilyThrows:+ if file is not a regular file or a symlinkC if we cannot read the file or the directory containting it if the file does not existthpath-directory^Open the given file as a filestream. Once the filestream exits, the filehandle is cleaned up.Throws:+ if file is not a regular file or a symlinkC if we cannot read the file or the directory containting it if the file does not existuhpath-directoryVWrite a given ByteString to a file, truncating the file beforehand. Follows symlinks.Throws:+ if file is not a regular file or a symlinkC if we cannot read the file or the directory containting it if the file does not existvhpath-directory[Write a given lazy ByteString to a file, truncating the file beforehand. Follows symlinks.Throws:+ if file is not a regular file or a symlinkC if we cannot read the file or the directory containting it if the file does not exist"Note: uses streamly under the hoodwhpath-directoryLAppend a given ByteString to a file. The file must exist. Follows symlinks.Throws:+ if file is not a regular file or a symlinkC if we cannot read the file or the directory containting it if the file does not existxhpath-directory#Default permissions for a new file.yhpath-directory(Default permissions for a new directory.zhpath-directory;Checks if the given file exists. Does not follow symlinks.+Only eNOENT is catched (and returns False).{hpath-directory,Checks whether a file or folder is readable.BOnly eACCES, eROFS, eTXTBSY, ePERM are catched (and return False).Throws: if the file does not exist|hpath-directory.Checks whether a file or folder is executable.BOnly eACCES, eROFS, eTXTBSY, ePERM are catched (and return False).Throws: if the file does not existhpath-directorytGets all filenames of the given directory. This excludes "." and "..". This version does not follow symbolic links.FThe contents are not sorted and there is no guarantee on the ordering.Throws: if directory does not exist if file type is wrong (file)( if file type is wrong (symlink to file)' if file type is wrong (symlink to dir) if directory cannot be openedhpath-directoryLike F, but returns the filename only, instead of prepending the base path.hpath-directoryYGet the file type of the file located at the given path. Does not follow symbolic links.Throws: if the file does not exist* if any part of the path is not accessible bhpath-directory source dirhpath-directory:destination (parent dirs are not automatically created)chpath-directorythe old symlink filehpath-directorydestination filedhpath-directory source filehpath-directorydestination filekhpath-directoryprogramhpath-directory argumentsphpath-directorydestination filehpath-directorypath the symlink points torhpath-directory file to movehpath-directory destinationuhpath-directoryif Nothing, file must existvhpath-directoryif Nothing, file must existhpath-directory dir to readhpath-directory dir to read5$%&'()TUVWXYZ[\]a^_`bcdefghijklmnopqrstuvwxyz{|}~5Z[\]a^_`WXYTUVbcdefghijklmnopqrstuvwxyz'&{%|$}~)(       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-hpath-directory-0.13.0-ARmQk2bJU9C7lyENXNzQIBSystem.Posix.ForeignSystem.Posix.FD"System.Posix.RawFilePath.Directory)System.Posix.RawFilePath.Directory.Errors-System.Posix.RawFilePath.Directory.Traversals System.PosixFilesFlagsUnsupportedFlagDirTypeunFlags isSupportedoCloexecdtBlkdtChrdtDirdtFifodtLnkdtRegdtSock dtUnknownoAppendoAsyncoCreat oDirectoryoExcloNoctty oNofollow oNonblockoRdonlyoWronlyoRdwroSyncoTruncpathMax unionFlags $fEqDirType $fShowDirType $fEqFlags $fShowFlagsopenFdcanOpenDirectory isWritabledoesDirectoryExist doesFileExisttoAbscanonicalizePathRecursiveFailureHintReadContentsFailedCreateDirFailedCopyFileFailedRecreateSymlinkFailedHPathIOExceptionSameFileDestinationInSourceRecursiveFailure isSameFileisDestinationInSourceisRecursiveFailureisReadContentsFailedisCreateDirFailedisCopyFileFailedisRecreateSymlinkFailedthrowFileDoesExistthrowDirDoesExist throwSameFilesameFilethrowDestinationInSource catchErrnorethrowErrnoAs handleIOError hideError bracketeer reactOnError$fExceptionHPathIOException$fEqRecursiveFailureHint$fShowRecursiveFailureHint$fEqHPathIOException$fShowHPathIOExceptionallDirectoryContentsallDirectoryContents'traverseDirectoryunpackDirStream packDirStream readDirEntgetDirectoryContents fdOpendirgetDirectoryContents'realpathCopyModeStrict OverwriteRecursiveErrorMode FailEarlyCollectFailuresFileType Directory RegularFile SymbolicLink BlockDeviceCharacterDevice NamedPipeSocketcopyDirRecursiverecreateSymlinkcopyFileeasyCopy deleteFile deleteDirdeleteDirRecursive easyDeleteopenFile executeFilecreateRegularFile createDircreateDirIfMissingcreateDirRecursive createSymlink renameFilemoveFilereadFilereadFileStream writeFile writeFileL appendFile newFilePerms newDirPerms doesExist isReadable isExecutablegetModificationTimesetModificationTimesetModificationTimeHiRes getDirsFiles getDirsFiles' getFileType $fEqFileType$fShowFileTypebaseGHC.IO.ExceptionIOError(exceptions-0.10.4-622ySnQapwMAU2KS1exqorControl.Monad.Catch catchIOError.safe-exceptions-0.1.7.0-JIns11DhTTRKUEalvQYe6pControl.Exception.Safebracket unix-2.7.2.2!System.Posix.Directory.ByteString openDirStream NoSuchThingPermissionDeniedInvalidArgumentInappropriateType AlreadyExistsUnsatisfiedConstraintsForeign.C.ErroreXDEVUnsupportedOperationSystem.Posix.Files.ByteStringrename