K      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ SafeReturns 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.) 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> experimentalportableSafeF*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).status flags of open(2)Just xJ => creates the file with the given modes, Nothing => the file must exist. 2016 Julian OspaldGPL-2"Julian Ospald <hasufell@posteo.de> experimentalportableSafe {If the value of the first argument is True, then execute the action provided in the second argument, otherwise do nothing.!|If the value of the first argument is False, then execute the action provided in the second argument, otherwise do nothing. ! ! ! ! 2016 Julian OspaldBSD3"Julian Ospald <hasufell@posteo.de> experimentalportableSafeF."Path separator character#*Check if a character is the path separator+\n -> (_chr n == '/') == isPathSeparator n$Search path separator%1Check if a character is the search path separator0\n -> (_chr n == ':') == isSearchPathSeparator n&File extension separator'4Check if a character is the file extension separator)\n -> (_chr n == '.') == isExtSeparator n(#Take a ByteString, split it on the $ . Blank items are converted to .. Follows the recommendations in Fhttp://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html#splitSearchPath "File1:File2:File3"["File1","File2","File3"]$splitSearchPath "File1::File2:File3"["File1",".","File2","File3"]splitSearchPath ""["."])Get a list of s in the $PATH variable.*Split a # into a path+filename and extensionsplitExtension "file.exe"("file",".exe")splitExtension "file" ("file","")"splitExtension "/path/file.tar.gz"("/path/file.tar",".gz"):\path -> uncurry (BS.append) (splitExtension path) == path+Get the final extension from a takeExtension "file.exe"".exe"takeExtension "file"""!takeExtension "/path/file.tar.gz"".gz",Change a file's extensionJ\path -> let ext = takeExtension path in replaceExtension path ext == path- Drop the final extension from a dropExtension "file.exe""file"dropExtension "file""file"!dropExtension "/path/file.tar.gz""/path/file.tar".Add an extension to a addExtension "file" ".exe" "file.exe"addExtension "file.tar" ".gz" "file.tar.gz"addExtension "/path/" ".ext" "/path/.ext"/ Check if a  has an extensionhasExtension "file"FalsehasExtension "file.tar"TruehasExtension "/path.part1/"False0Operator version of .1Split a  on the first extension.#splitExtensions "/path/file.tar.gz"("/path/file",".tar.gz")<\path -> uncurry addExtension (splitExtensions path) == path2Remove all extensions from a "dropExtensions "/path/file.tar.gz" "/path/file"3Take all extensions from a "takeExtensions "/path/file.tar.gz" ".tar.gz"42Drop the given extension from a FilePath, and the "." preceding it. Returns 8 if the FilePath does not have the given extension, or . and the part before the extension if it does.+This function can be more predictable than 23, especially if the filename might itself contain . characters."stripExtension "hs.o" "foo.x.hs.o" Just "foo.x""stripExtension "hi.o" "foo.x.hs.o"NothingstripExtension ".c.d" "a.b.c.d" Just "a.b" stripExtension ".c.d" "a.b..c.d" Just "a.b."stripExtension "baz" "foo.bar"NothingstripExtension "bar" "foobar"Nothing,\path -> stripExtension "" path == Just pathS\path -> dropExtension path == fromJust (stripExtension (takeExtension path) path)T\path -> dropExtensions path == fromJust (stripExtension (takeExtensions path) path)5Split a  into (path,file). = is the inversesplitFileName "path/file.txt"("path/","file.txt")splitFileName "path/" ("path/","")splitFileName "file.txt"("./","file.txt")Y\path -> uncurry combine (splitFileName path) == path || fst (splitFileName path) == "./"6Get the file nametakeFileName "path/file.txt" "file.txt"takeFileName "path/"""7Change the file name9\path -> replaceFileName path (takeFileName path) == path8Drop the file namedropFileName "path/file.txt""path/"dropFileName "file.txt""./"9/Get the file name, without a trailing extensiontakeBaseName "path/file.tar.gz" "file.tar"takeBaseName """":Change the base name(replaceBaseName "path/file.tar.gz" "bob" "path/bob.gz"9\path -> replaceBaseName path (takeBaseName path) == path;BGet the directory, moving up one level if it's already a directorytakeDirectory "path/file.txt""path"takeDirectory "file""."takeDirectory "/path/to/" "/path/to"takeDirectory "/path/to""/path"<$Change the directory component of a e\path -> replaceDirectory path (takeDirectory path) `equalFilePath` path || takeDirectory path == "."=Join two paths togethercombine "/" "file""/file"combine "/path/to" "file""/path/to/file"combine "file" "/absolute/path""/absolute/path">Operator version of combine?'Split a path into a list of components:splitPath "/path/to/file.txt"["/","path/","to/","file.txt"]+\path -> BS.concat (splitPath path) == path@Join a split path back together*\path -> joinPath (splitPath path) == path!joinPath ["path","to","file.txt"]"path/to/file.txt"ALike ?, but without trailing slashes$splitDirectories "/path/to/file.txt"["/","path","to","file.txt"]splitDirectories ""[]B!Check if the last character of a  is .!hasTrailingPathSeparator "/path/"TruehasTrailingPathSeparator "/"True hasTrailingPathSeparator "/path"FalseCAdd a trailing path separator. addTrailingPathSeparator "/path""/path/"!addTrailingPathSeparator "/path/""/path/"addTrailingPathSeparator "/""/"D Remove a trailing path separator"dropTrailingPathSeparator "/path/""/path"%dropTrailingPathSeparator "/path////""/path"dropTrailingPathSeparator "/""/"dropTrailingPathSeparator "//""/"ENormalise a file. normalise "/file/\\test////""/file/\\test/"normalise "/file/./test" "/file/test"#normalise "/test/file/../bob/fred/""/test/file/../bob/fred/"normalise "../bob/fred/""../bob/fred/"normalise "./bob/fred/" "bob/fred/",normalise "./bob////.fred/./...///./..///#.""bob/.fred/.../../#." normalise ".""."normalise "./""./"normalise "./.""./"normalise "/./""/" normalise "/""/"normalise "bob/fred/." "bob/fred/"normalise "//home""/home"FbContract a filename, based on a relative path. Note that the resulting path will never introduce ..+ paths, as the presence of symlinks means ../b may not reach a/b if it starts from a/c. For a worked example see  Vhttp://neilmitchell.blogspot.co.uk/2015/10/filepaths-are-subtle-symlinks-are-hard.htmlthis blog post./makeRelative "/directory" "/directory/file.ext" "file.ext" makeRelative "/Home" "/home/bob" "/home/bob")makeRelative "/home/" "/home/bob/foo/bar" "bob/foo/bar"makeRelative "/fred" "bob""bob"+makeRelative "/file/test" "/file/test/fred""fred",makeRelative "/file/test" "/file/test/fred/""fred/"*makeRelative "some/path" "some/path/a/b/c""a/b/c"\p -> makeRelative p p == "."E\p -> makeRelative (takeDirectory p) p `equalFilePath` takeFileName p]prop x y -> equalFilePath x y || (isRelative x && makeRelative y x == x) || equalFilePath (y  / makeRelative y x) xGbEquality of two filepaths. The filepaths are normalised and trailing path separators are dropped.equalFilePath "foo" "foo"TrueequalFilePath "foo" "foo/"TrueequalFilePath "foo" "./foo"TrueequalFilePath "" ""TrueequalFilePath "foo" "/foo"FalseequalFilePath "foo" "FOO"FalseequalFilePath "foo" "../foo"False\p -> equalFilePath p pHCheck if a path is relative+\path -> isRelative path /= isAbsolute pathICheck if a path is absoluteisAbsolute "/path"TrueisAbsolute "path"False isAbsolute ""FalseJ:Is a FilePath valid, i.e. could you create a file like it? isValid ""False isValid "\0"FalseisValid "/random_ path:*"TrueKKTake a FilePath and make it valid; does not change already valid FilePaths. makeValid """_"makeValid "file\0name" "file_name">\p -> if isValid p then makeValid p == p else makeValid p /= p\p -> isValid (makeValid p)L@Is the given path a valid filename? This includes "." and "..".isFileName "lal"TrueisFileName "."TrueisFileName ".."True isFileName ""FalseisFileName "\0"FalseisFileName "/random_ path:*"FalseM7Check if the filepath has any parent directories in it.hasParentDir "/.."TruehasParentDir "foo/bar/.."TruehasParentDir "foo/../bar/."TruehasParentDir "foo/bar"FalsehasParentDir "foo"FalsehasParentDir ""FalsehasParentDir ".."FalseN"Whether the file is a hidden file.hiddenFile ".foo"TruehiddenFile "..foo.bar"TruehiddenFile "some/path/.bar"TruehiddenFile "..."TruehiddenFile "dod.bar"FalsehiddenFile "."FalsehiddenFile ".."False hiddenFile ""False0Combine two paths, assuming rhs is NOT absolute./"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN;"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN-"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN/"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN 2016 Julian OspaldBSD3"Julian Ospald <hasufell@posteo.de> experimentalportableNone FMO6Get all files from a directory and its subdirectories.Upon entering a directory, Oy 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.P?Get all files from a directory and its subdirectories strictly.)Follows symbolic links for the input dir.QRecursively 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.U.Gets all directory contents (not recursively).V Binding to  fdopendir(3).WLike U except for a file descriptor.;To avoid complicated error checks, the file descriptor is always closed, even if V2 fails. Usually, this only happens on successful VD and after the directory stream is closed. Also see the manpage of  fdopendir(3) for more details.X*return the canonicalized absolute pathname like canonicalizePath, but uses  realpath(3)OPQRSTUVWX OPQRSTUVWX UWOPQTSRVXOPQRSTUVWX Safe+YPath of some base and type.FInternally is a ByteString. The ByteString can be of two formats only: !without trailing path separator: file.txt,  foo/bar.txt,  /foo/bar.txtwith trailing path separator: foo/,  /foo/bar/(There are no duplicate path separators //, no .., no ./, no ~/, etc.Same as  .The following property holds: x == y "a show x == show yByteString ordering.The following property holds: 'show x `compare` show y "a x `compare` yByteString equality.The following property holds: show x == show y "a x == yYYY+ 2015 2016 FP Complete, 2016 Julian Ospald BSD 3 clause"Julian Ospald <hasufell@posteo.de> experimentalportableSafe+Z\"Exception when parsing a location.]A filename, without any .^$A relative path; one without a root._An absolute path.a@Get a location for an absolute path. Produces a normalised path.Throws: \,parseAbs "/abc" :: Maybe (Path Abs) Just "/abc",parseAbs "/" :: Maybe (Path Abs)Just "/",parseAbs "/abc/def" :: Maybe (Path Abs)Just "/abc/def",parseAbs "/abc/def/.///" :: Maybe (Path Abs)Just "/abc/def/",parseAbs "abc" :: Maybe (Path Abs)Nothing,parseAbs "" :: Maybe (Path Abs)Nothing,parseAbs "/abc/../foo" :: Maybe (Path Abs)Nothingb@Get a location for a relative path. Produces a normalised path. Note that filepath may contain any number of ./ but may not consist solely of ./$. It also may not contain a single .. anywhere.Throws: \ )parseRel "abc" :: Maybe (Path Rel) Just "abc")parseRel "def/" :: Maybe (Path Rel) Just "def/")parseRel "abc/def" :: Maybe (Path Rel)Just "abc/def")parseRel "abc/def/." :: Maybe (Path Rel)Just "abc/def/")parseRel "/abc" :: Maybe (Path Rel)Nothing)parseRel "" :: Maybe (Path Rel)Nothing)parseRel "abc/../foo" :: Maybe (Path Rel)Nothing)parseRel "." :: Maybe (Path Rel)Nothing)parseRel ".." :: Maybe (Path Rel)NothingcAParses a filename. Filenames must not contain slashes. Excludes  and '..'.Throws: \ 'parseFn "abc" :: Maybe (Path Fn) Just "abc"'parseFn "..." :: Maybe (Path Fn) Just "..."'parseFn "def/" :: Maybe (Path Fn)Nothing'parseFn "abc/def" :: Maybe (Path Fn)Nothing'parseFn "abc/def/." :: Maybe (Path Fn)Nothing'parseFn "/abc" :: Maybe (Path Fn)Nothing'parseFn "" :: Maybe (Path Fn)Nothing'parseFn "abc/../foo" :: Maybe (Path Fn)Nothing'parseFn "." :: Maybe (Path Fn)Nothing'parseFn ".." :: Maybe (Path Fn)Nothingd&Convert any Path to a ByteString type.e.Convert an absolute Path to a ByteString type.f-Convert a relative Path to a ByteString type.gAppend two paths.bThe second argument must always be a relative path, which ensures that undefinable things like `"abc" <> "/def"` cannot happen.Technically, the first argument can be a path that points to a non-directory, because this library is IO-agnostic and makes no assumptions about file types.7(MkPath "/") </> (MkPath "file" :: Path Rel)"/file"7(MkPath "/path/to") </> (MkPath "file" :: Path Rel)"/path/to/file"7(MkPath "/") </> (MkPath "file/lal" :: Path Rel) "/file/lal"7(MkPath "/") </> (MkPath "file/" :: Path Rel)"/file/"hIStrip directory from path, making it relative to that directory. Throws Couldn'tStripPrefixDir* if directory is not a parent of the path.The bases must match.N(MkPath "/lal/lad") `stripDir` (MkPath "/lal/lad/fad") :: Maybe (Path Rel) Just "fad"N(MkPath "lal/lad") `stripDir` (MkPath "lal/lad/fad") :: Maybe (Path Rel) Just "fad"N(MkPath "/") `stripDir` (MkPath "/") :: Maybe (Path Rel)NothingN(MkPath "/lal/lad/fad") `stripDir` (MkPath "/lal/lad") :: Maybe (Path Rel)NothingN(MkPath "fad") `stripDir` (MkPath "fad") :: Maybe (Path Rel)Nothingi>Is p a parent of the given location? Implemented in terms of h. The bases must match.<(MkPath "/lal/lad") `isParentOf` (MkPath "/lal/lad/fad")True;(MkPath "lal/lad") `isParentOf` (MkPath "lal/lad/fad")True1(MkPath "/") `isParentOf` (MkPath "/")False8(MkPath "/lal/lad/fad") `isParentOf` (MkPath "/lal/lad")False3(MkPath "fad") `isParentOf` (MkPath "fad")FalsejGet all parents of a path.%getAllParents (MkPath "/abs/def/dod")["/abs/def","/abs","/"]getAllParents (MkPath "/")[]k%Extract the directory name of a path.The following properties hold: dirname (p </> a) == dirname pdirname (MkPath "/abc/def/dod") "/abc/def"dirname (MkPath "/")"/"l Extract the file part of a path.The following properties hold:  basename (p </> a) == basename aThrows: [ if given the root path "/"3basename (MkPath "/abc/def/dod") :: Maybe (Path Fn) Just "dod"3basename (MkPath "/") :: Maybe (Path Fn)Nothing Z[\]^_`abcdefghijklmnoYZ[\]^_`abcdefghijklmno_Y^]\[Z`acbefdglkijhmnoZ[\]^_`abcdefghijklmno 2016 Julian OspaldGPL-2"Julian Ospald <hasufell@posteo.de> experimentalportableSafe+N Uses } and throws t if it returns True.^Check if the files are the same by examining device and file id. This follows symbolic links.Checks 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.RChecks if the given file exists and is not a directory. Does not follow symlinks.NChecks if the given file exists and is a directory. Does not follow symlinks.,Checks whether a file or folder is writable.WChecks whether the directory at the given path exists and can be opened. This invokes  openDirStream which follows symlinks. Throws a yG HPathIOException if the directory at the given path cannot be opened.Carries 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.Execute 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.Like , with arguments swapped.Like , but allows to have different clean-up actions depending on whether the in-between computation has raised an exception or not. &qrstuvwxyz{|}~ source dirfull destination,  dirname dest must existerrno to catch-action to try, which can raise an IOExceptionEaction to carry out in case of an IOException and if errno matcheserrno to catchrethrow as if errno matches action to trycomputation to run first8computation to run last, when no exception was raised8computation to run last, when an exception was raisedcomputation to run in-betweenreaction on IO errorsreaction on HPathIOException$qrstuvwxyz{|}~$qrstuvwxyz{|}~q rstuvwxyz{|}~ 2016 Julian OspaldGPL-2"Julian Ospald <hasufell@posteo.de> experimentalportableNoneMpApplies realpath on the given absolute path.Throws:- if the file at the given path does not exist if the symlink is brokenYCopies a directory recursively to the given destination. Does not follow symbolic links.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 output directory is not writable$ if source directory can't be opened, if source directory is wrong type (symlink)1 if source directory is wrong type (regular file) if destination already existst. if source and destination are the same file (q)u( if destination is contained in source (q)Like 6 except it overwrites contents of directories if any.Throws:# if source directory does not exist$ if output directory is not writable$ if source directory can't be opened, if source directory is wrong type (symlink)1 if source directory is wrong type (regular file)t. if source and destination are the same file (q)u( if destination is contained in source (q)Recreate a symlink.Throws:% if symlink file is wrong type (file)* if symlink file is wrong type (directory)) if output directory cannot be written to% if source directory cannot be opened# if destination file already existst. if source and destination are the same file (q) Note: calls symlinkCopies the given regular file to the given destination. Neither follows symbolic links, nor accepts them. For "copying" symbolic links, use  instead.Throws: if source file does not exist$ if output directory is not writable$ if source directory can't be opened' if source file is wrong type (symlink)) if source file is wrong type (directory) if destination already existst. if source and destination are the same file (q) Note: calls sendfile and possibly /write as fallbackLike z except it overwrites the destination if it already exists. This also works if source and destination are the same file.Safety/reliability concerns:$not atomic, since it uses read/writeThrows: if source file does not exist$ if output directory is not writable$ if source directory can't be opened' if source file is wrong type (symlink)) if source file is wrong type (directory)t. if source and destination are the same file (q) Note: calls sendfile and possibly /write as fallback_Copies anything. In case of a symlink, it is just recreated, even if it points to a directory.Safety/reliability concerns:examines filetypes explicitlycalls  for directoriesLike  except it overwrites the destination if it already exists. For directories, this overwrites contents without pruning them, so the resulting directory may have more files than have been copied.Deletes 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 readADeletes 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 rmdirPDeletes the given directory recursively. Does not follow symbolic links. Tries / first before attemtping a recursive deletion.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 directoryDeletes a file, directory or symlink, whatever it may be. In case of directory, performs recursive deletion. In case of a symlink, the symlink file is deleted.Safety/reliability concerns:examines filetypes explicitlycalls  for directorieseOpens a file appropriately by invoking xdg-open. The file type is not checked. This forks a process.BExecutes a program with the given arguments. This forks a process.LCreate an empty regular file at the given directory with the given filename.Throws:) if output directory cannot be written to# if destination file already existsICreate an empty directory at the given directory with the given filename.Throws:) if output directory cannot be written to( if destination directory already existsCreate a symlink.Throws:) if output directory cannot be written to# if destination file already exists Note: calls symlinknRename 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 opened3 if source and destination are on different devicesv% if destination file already exists (q)w* if destination directory already exists (q)t. if destination and source are the same file (q) Note: calls 3 (but does not allow to rename over existing files)dMove 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:-copy-delete fallback is inherently non-atomicThrows: if source file does not exist) if output directory cannot be written to% if source directory cannot be openedv% if destination file already exists (q)w* if destination directory already exists (q)t. if destination and source are the same file (q) Note: calls 3 (but does not allow to rename over existing files)Like ., but overwrites the destination if it exists.CDoes not follow symbolic links, but renames the symbolic link file.Safety/reliability concerns:-copy-delete fallback is inherently non-atomic?checks for file types and destination file existence explicitlyThrows: if source file does not exist) if output directory cannot be written to% if source directory cannot be openedt. if destination and source are the same file (q) Note: calls 3 (but does not allow to rename over existing files)#Default permissions for a new file.(Default permissions for a new directory.tGets all filenames of the given directory. This excludes "." and "..". This version does not follow symbolic links.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 openedYGet 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!p source dirfull destination source dirfull destinationthe old symlink filedestination file source filedestination file source filedestination file source filedestination fileprogram argumentsdestination filepath the symlink points to file to move destination file to move destination dir to read p pp   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abc defghijdklm noIpqrstuvwxyz{|}~  hpath_Dsul9gWLhi8FMdBegkC1oqSystem.Posix.Directory.ForeignSystem.Posix.FDHPath.IO.UtilsSystem.Posix.FilePath!System.Posix.Directory.TraversalsHPathHPath.IOHPath.IO.Errors System.PosixFilesHPath.Internal toFilePathFlagsUnsupportedFlagDirTypeunFlags isSupportedoCloexecdtBlkdtChrdtDirdtFifodtLnkdtRegdtSock dtUnknownoAppendoAsyncoCreat oDirectoryoExcloNoctty oNofollow oNonblockoRdonlyoWronlyoRdwroSyncoTruncpathMax unionFlagsopenFdwhenMunlessM pathSeparatorisPathSeparatorsearchPathSeparatorisSearchPathSeparator extSeparatorisExtSeparatorsplitSearchPath getSearchPathsplitExtension takeExtensionreplaceExtension dropExtension addExtension hasExtension<.>splitExtensionsdropExtensionstakeExtensionsstripExtension splitFileName takeFileNamereplaceFileName dropFileName takeBaseNamereplaceBaseName takeDirectoryreplaceDirectorycombine splitPathjoinPathsplitDirectorieshasTrailingPathSeparatoraddTrailingPathSeparatordropTrailingPathSeparator normalise makeRelative equalFilePath isRelative isAbsoluteisValid makeValid isFileName hasParentDir hiddenFileallDirectoryContentsallDirectoryContents'traverseDirectoryunpackDirStream packDirStream readDirEntgetDirectoryContents fdOpendirgetDirectoryContents'realpathPathRelC PathExceptionPathParseExceptionFnRelAbsparseAbsparseRelparseFnfromAbsfromRelstripDir isParentOf getAllParentsdirnamebasename withAbsPath withRelPath withFnPathcanonicalizePathHPathIOExceptionFileDoesNotExistDirDoesNotExistSameFileDestinationInSource FileDoesExist DirDoesExistInvalidOperationCan'tOpenDirectory CopyFailedisFileDoesNotExistisDirDoesNotExist isSameFileisDestinationInSourceisFileDoesExistisDirDoesExistisInvalidOperationisCan'tOpenDirectory isCopyFailedthrowFileDoesExistthrowDirDoesExistthrowFileDoesNotExistthrowDirDoesNotExist throwSameFilesameFilethrowDestinationInSource doesFileExistdoesDirectoryExist isWritablecanOpenDirectorythrowCantOpenDirectory catchErrnorethrowErrnoAs handleIOError bracketeer reactOnErrorFileType Directory RegularFile SymbolicLink BlockDeviceCharacterDevice NamedPipeSocketcopyDirRecursivecopyDirRecursiveOverwriterecreateSymlinkcopyFilecopyFileOverwriteeasyCopyeasyCopyOverwrite deleteFile deleteDirdeleteDirRecursive easyDeleteopenFile executeFilecreateRegularFile createDir createSymlink renameFilemoveFilemoveFileOverwrite newFilePerms newDirPerms getDirsFiles getFileTypec_openopen_unix_KZL8h98IqDM57kQSPo1mKx System.Posix.ByteString.FilePath RawFilePathbaseGHC.BaseNothingJustGHC.Real/ combineRawsplitFileNameRawthrowErrnoPathIfMinus1_throwErrnoPathIfMinus1throwErrnoPathIfNullthrowErrnoPathIf_throwErrnoPathIfthrowErrnoPaththrowErrnoPathIfRetrythrowErrnoPathIfNullRetrythrowErrnoPathIfMinus1Retry_throwErrnoPathIfMinus1RetrypeekFilePathLen peekFilePath withFilePathCDirentCDir c_fdopendir c_realpathc_typec_name c_freeDirEnt c_readdiractOnDirContents_dirloop $fShowPath $fOrdPath$fEqPathMkPath $fNFDataPath.RootDirHasNoBasename InvalidAbs InvalidRel InvalidFnCouldn'tStripPrefixTPS stripPrefix$fRelCFn $fRelCRel$fExceptionPathException$fExceptionPathParseExceptionSystem.IO.Error catchIOErrorControl.Exception.Basebracket$fExceptionHPathIOException$fShowHPathIOExceptionGHC.IO.Exception NoSuchThingPermissionDeniedInvalidArgument AlreadyExists Text.ReadreadInappropriateTypeUnsatisfiedConstraintsForeign.C.ErroreXDEVUnsupportedOperationSystem.Posix.Files.ByteStringrename _copyFile