SE      !"#$%&'()*+,-./0123456789:;<=>?@ABCDSafeSafeEFGHEFGHEFGHSafeIJKLMNOIJKLMNIJKLMNOSafeOFilename extension for executable files (including the dot if any) (usually "" on POSIX systems and ".exe" on Windows or OS/2).Safe EFGHIJKLMN"(c) The University of Glasgow 2001/BSD-style (see the file libraries/base/LICENSE)libraries@haskell.orgstableportableSafe<zSpecial directories for storing user-specific application data, configuration, and cache files, as specified by the  Fhttp://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html XDG Base Directory Specification.Note: On Windows,  and  map to the same directory.-For data files (e.g. images). Defaults to ~/.local/share! and can be overridden by the  XDG_DATA_HOME, environment variable. On Windows, it is  %APPDATA% (e.g.  C:/Users/<user>/AppData/Roaming;). Can be considered as the user-specific equivalent of  /usr/share.(For configuration files. Defaults to  ~/.config! and can be overridden by the XDG_CONFIG_HOME, environment variable. On Windows, it is  %APPDATA% (e.g.  C:/Users/<user>/AppData/Roaming;). Can be considered as the user-specific equivalent of /etc.5For non-essential files (e.g. cache). Defaults to ~/.cache! and can be overridden by the XDG_CACHE_HOME, environment variable. On Windows, it is %LOCALAPPDATA% (e.g.  C:/Users/<user>/AppData/Local;). Can be considered as the user-specific equivalent of  /var/cache.PQ: not a directory.R.: a true directory (not a symbolic link).S6: a directory symbolic link (only exists on Windows).The = operation returns the permissions for the file or directory.The operation may fail with:T= if the user is not permitted to access the permissions; orU) if the file or directory does not exist.The : operation sets the permissions for the file or directory.The operation may fail with:T: if the user is not permitted to set the permissions; orU) if the file or directory does not exist. dir creates a new directory dirN which is initially empty, or as near to empty as the operating system allows.The operation may fail with:T / PermissionDeniedC The process has insufficient privileges to perform the operation. [EROFS, EACCES]V /  AlreadyExists8 The operand refers to a directory that already exists.  [EEXIST] HardwareFault$ A physical I/O error has occurred. [EIO]InvalidArgument, The operand is not a valid directory name. [ENAMETOOLONG, ELOOP] NoSuchThing$ There is no path to the directory. [ENOENT, ENOTDIR]ResourceExhausted Insufficient resources (virtual memory, process file descriptors, physical disk space, etc.) are available to perform the operation.  [EDQUOT, ENOSPC, ENOMEM, EMLINK]W6 The path refers to an existing non-directory object. [EEXIST] parents dir creates a new directory dir/ if it doesn't exist. If the first argument is XK the function will also create all parent directories if they are missing.YObtain the type of a directory. dir removes an existing directory dir. The implementation may specify additional constraints which must be satisfied before a directory can be removed (e.g. the directory has to be empty, or may not be in use by other processes). It is not legal for an implementation to partially remove a directory unless the entire directory is removed. A conformant implementation need not support directory removal in all situations (e.g. removal of the root directory).The operation may fail with: HardwareFault$ A physical I/O error has occurred. [EIO]InvalidArgument, The operand is not a valid directory name. [ENAMETOOLONG, ELOOP]U /  NoSuchThing The directory does not exist. [ENOENT, ENOTDIR]T / PermissionDeniedC The process has insufficient privileges to perform the operation. [EROFS, EACCES, EPERM]UnsatisfiedConstraints9 Implementation-dependent constraints are not satisfied. [EBUSY, ENOTEMPTY, EEXIST]UnsupportedOperation@ The implementation does not support removal in this situation. [EINVAL]W9 The operand refers to an existing non-directory object.  [ENOTDIR] dir removes an existing directory dir together with its contents and subdirectories. Within this directory, symbolic links are removed without affecting their targets.#On Windows, the operation fails if dir is a directory symbolic link.ZZ path+ removes an existing file or directory at pathp together with its contents and subdirectories. Symbolic links are removed without affecting their the targets.[[ dir( removes the contents of the directory dirN recursively. Symbolic links are removed without affecting their the targets. file2 removes the directory entry for an existing file file, where file is not itself a directory. The implementation may specify additional constraints which must be satisfied before a file can be removed (e.g. the file may not be in use by other processes).The operation may fail with: HardwareFault$ A physical I/O error has occurred. [EIO]InvalidArgument' The operand is not a valid file name. [ENAMETOOLONG, ELOOP]U /  NoSuchThing The file does not exist. [ENOENT, ENOTDIR]T / PermissionDeniedC The process has insufficient privileges to perform the operation. [EROFS, EACCES, EPERM]UnsatisfiedConstraints9 Implementation-dependent constraints are not satisfied. [EBUSY]W. The operand refers to an existing directory. [EPERM, EINVAL] old new0 changes the name of an existing directory from old to new . If the new< directory already exists, it is atomically replaced by the old directory. If the new directory is neither the old directory nor an alias of the old# directory, it is removed as if by . A conformant implementation need not support renaming directories in all situations (e.g. renaming to an existing directory, or across different physical devices), but the constraints must be documented.On Win32 platforms, renameDirectory fails if the new directory already exists.The operation may fail with: HardwareFault$ A physical I/O error has occurred. [EIO]InvalidArgument/ Either operand is not a valid directory name. [ENAMETOOLONG, ELOOP]U /  NoSuchThingK The original directory does not exist, or there is no path to the target. [ENOENT, ENOTDIR]T / PermissionDeniedC The process has insufficient privileges to perform the operation. [EROFS, EACCES, EPERM]ResourceExhausted@ Insufficient resources are available to perform the operation.  [EDQUOT, ENOSPC, ENOMEM, EMLINK]UnsatisfiedConstraints9 Implementation-dependent constraints are not satisfied. [EBUSY, ENOTEMPTY, EEXIST]UnsupportedOperationA The implementation does not support renaming in this situation. [EINVAL, EXDEV]W9 Either path refers to an existing non-directory object. [ENOTDIR, EISDIR] old new9 changes the name of an existing file system object from old to new . If the new9 object already exists, it is atomically replaced by the old object. Neither path may refer to an existing directory. A conformant implementation need not support renaming files in all situations (e.g. renaming across different physical devices), but the constraints must be documented.The operation may fail with: HardwareFault$ A physical I/O error has occurred. [EIO]InvalidArgument* Either operand is not a valid file name. [ENAMETOOLONG, ELOOP]U /  NoSuchThingF The original file does not exist, or there is no path to the target. [ENOENT, ENOTDIR]T / PermissionDeniedC The process has insufficient privileges to perform the operation. [EROFS, EACCES, EPERM]ResourceExhausted@ Insufficient resources are available to perform the operation.  [EDQUOT, ENOSPC, ENOMEM, EMLINK]UnsatisfiedConstraints9 Implementation-dependent constraints are not satisfied. [EBUSY]UnsupportedOperationA The implementation does not support renaming in this situation. [EXDEV]W. Either path refers to an existing directory. ,[ENOTDIR, EISDIR, EINVAL, EEXIST, ENOTEMPTY]Copy a file with its permissions. If the destination file already exists, it is replaced atomically. Neither path may refer to an existing directory. No exceptions are thrown if the permissions could not be copied.\Truncate the destination file and then copy the contents of the source file to the destination file. If the destination file already exists, its attributes shall remain unchanged. Otherwise, its attributes are reset to the defaults.]iCopy the contents of a source file to a destination file, replacing the destination file atomically via ^D, resetting the attributes of the destination file to the defaults.^A helper function useful for replacing files in an atomic manner. The function creates a temporary file in the directory of the destination file, opens it, performs the main action with its handle, closes it, performs the post-action with its path, and finally replaces the destination file with the temporary file. If an error occurs during any step of this process, the temporary file is removed and the destination file remains untouched._NAttempt to perform the given action, silencing any IO exception thrown by it.`&Copy all data from a file to a handle.a7Copy data from one handle to another until end of file.TCopy a file with its associated metadata. If the destination file already exists, it is overwritten. There is no guarantee of atomicity in the replacement of the destination file. Neither path may refer to an existing directory. If the source and/or destination are symbolic links, the copy is performed on the targets of the links.0On Windows, it behaves like the Win32 function  Fhttps://msdn.microsoft.com/en-us/library/windows/desktop/aa363851.aspxCopyFilef, which copies various kinds of metadata including file attributes and security resource properties.2On Unix-like systems, permissions, access time, and modification time are preserved. If possible, the owner and group are also preserved. Note that the very act of copying can change the access time of the source file, hence the access times of the two files may differ after the operation completes.|Make a path absolute and remove as many indirections from it as possible. Indirections include the two special directories . and ..p, as well as any Unix symbolic links. The input path does not have to point to an existing file or directory.Note): if you only need an absolute path, use W instead. Most programs should not worry about whether a path contains symbolic links.7Since symbolic links and the special parent directory (..) are dependent on the state of the existing filesystem, the function can only make a conservative attempt by removing symbolic links and ..P from the longest prefix of the path that still points to an existing file or directory. If the input path points to an existing file or directory, then the output path shall also point to the same file or directory, provided that the relevant parts of the filesystem have not changed in the meantime (the function is not atomic).Despite the name, the function does not guarantee canonicity of the returned path due to the presence of hard links, mount points, etc. Similar to b, passing an empty path is equivalent to passing the current directory. The function preserves the presence or absence of the trailing path separator unless the path refers to the root directory /. Known bug(s);: on Windows, the function does not resolve symbolic links.Changes since 1.2.3.0:Y The function has been altered to be more robust and has the same exception behavior as .Convert a path into an absolute path. If the given path is relative, the current directory is prepended and then the combined result is b9d. If the path is already absolute, the path is simply bd. The function preserves the presence or absence of the trailing path separator unless the path refers to the root directory /.|If the path is already absolute, the operation never fails. Otherwise, the operation may fail with the same exceptions as '.cConvert a path into an absolute path. If the given path is relative, the current directory is prepended. If the path is already absolute, the path is returned unchanged. The function preserves the presence or absence of the trailing path separator.|If the path is already absolute, the operation never fails. Otherwise, the operation may fail with the same exceptions as '.(internal API)dlAdd or remove the trailing path separator in the second path so as to match its presence in the first path.(internal API)@Construct a path relative to the current directory, similar to e.3The operation may fail with the same exceptions as '.Given an executable file name, searches for such file in the directories listed in system PATH. The returned value is the path to the found executable or Nothing if an executable with the given name was not found. For example (findExecutable "ghc") gives you the path to GHC.The path returned by 7 corresponds to the program that would be executed by D when passed the same string (as a RawCommand, not a ShellCommand). On Windows,  calls the Win32 function  SearchPathE, which may search other places before checking the directories in PATH. Where it actually searches depends on registry settings, but notably includes the directory containing the current executable. See  5http://msdn.microsoft.com/en-us/library/aa365527.aspx for more details.cGiven a file name, searches for the file and returns a list of all occurences that are executable.IOn Windows, this only returns the first ocurrence, if any. It uses the  SearchPath- from the Win32 API, so the caveats noted in  apply here as well.fGet the contents of the PATH environment variable. vGiven a file name, searches for the file on the given paths and returns a list of all occurences that are executable.g"Test whether a file is executable.!?Search through the given set of directories for the given file."xSearch through the given set of directories for the given file and returns a list of paths where the given file exists.#Search through the given set of directories for the given file and with the given property (usually permissions) and returns the file path where the given file exists and has the property.h  for   , essentially.Returns the first i in the list or j if there aren't any.$Search through the given set of directories for the given file and with the given property (usually permissions) and returns a list of paths where the given file exists and has the property.kLike #', but searches only a single directory.% Similar to &+, but always includes the special entries (. and ..&). (This applies to Windows as well.)3The operation may fail with the same exceptions as &.&& dir returns a list of all entries in dir without the special entries (. and ..).The operation may fail with: HardwareFault* A physical I/O error has occurred. [EIO]InvalidArgument2 The operand is not a valid directory name. [ENAMETOOLONG, ELOOP]U /  NoSuchThing% The directory does not exist. [ENOENT, ENOTDIR]T / PermissionDeniedI The process has insufficient privileges to perform the operation. [EACCES]ResourceExhaustedF Insufficient resources are available to perform the operation. [EMFILE, ENFILE]W< The path refers to an existing non-directory object.  [ENOTDIR]'9Obtain the current working directory as an absolute path. In a multithreaded program, the current working directory is a global state shared among all threads of the process. Therefore, when performing filesystem operations from multiple threads, it is highly recommended to use absolute rather than relative paths (see: ).The operation may fail with: HardwareFault& A physical I/O error has occurred. [EIO]U or  NoSuchThing8 There is no path referring to the working directory. [EPERM, ENOENT, ESTALE...]T or PermissionDeniedE The process has insufficient privileges to perform the operation. [EACCES]ResourceExhausted@ Insufficient resources are available to perform the operation.UnsupportedOperationB The operating system has no notion of current working directory.(/Change the working directory to the given path. In a multithreaded program, the current working directory is a global state shared among all threads of the process. Therefore, when performing filesystem operations from multiple threads, it is highly recommended to use absolute rather than relative paths (see: ).The operation may fail with: HardwareFault& A physical I/O error has occurred. [EIO]InvalidArgument. The operand is not a valid directory name. [ENAMETOOLONG, ELOOP]U or  NoSuchThing! The directory does not exist. [ENOENT, ENOTDIR]T or PermissionDeniedE The process has insufficient privileges to perform the operation. [EACCES]UnsupportedOperation{ The operating system has no notion of current working directory, or the working directory cannot be dynamically changed.W8 The path refers to an existing non-directory object.  [ENOTDIR])Run an l action with the given working directory and restore the original working directory afterwards, even if the given action fails due to an exception.3The operation may fail with the same exceptions as ' and (.*The operation * returns X^ if the argument file exists and is either a directory or a symbolic link to a directory, and m otherwise.+The operation + returns X9 if the argument file exists and is not a directory, and m otherwise.,OCheck whether the path refers to a symbolic link. On Windows, this tests for FILE_ATTRIBUTE_REPARSE_POINT.-AObtain the time at which the file or directory was last accessed.The operation may fail with:T< if the user is not permitted to read the access time; orU) if the file or directory does not exist.Caveat for POSIX systems: This function returns a timestamp with sub-second resolution only if this package is compiled against  unix-2.6.0.07 or later and the underlying filesystem supports them..AObtain the time at which the file or directory was last modified.The operation may fail with:TB if the user is not permitted to read the modification time; orU) if the file or directory does not exist.Caveat for POSIX systems: This function returns a timestamp with sub-second resolution only if this package is compiled against  unix-2.6.0.07 or later and the underlying filesystem supports them./AChange the time at which the file or directory was last accessed.The operation may fail with:T= if the user is not permitted to alter the access time; orU) if the file or directory does not exist.Some caveats for POSIX systems:Not all systems support  utimensat, in which case the function can only emulate the behavior by reading the modification time and then setting both the access and modification times together. On systems where  utimensatN is supported, the access time is set atomically with nanosecond precision.!If compiled against a version of unix prior to 2.7.0.0, the function would not be able to set timestamps with sub-second resolution. In this case, there would also be loss of precision in the modification time.0AChange the time at which the file or directory was last modified.The operation may fail with:TC if the user is not permitted to alter the modification time; orU) if the file or directory does not exist.Some caveats for POSIX systems:Not all systems support  utimensat, in which case the function can only emulate the behavior by reading the access time and then setting both the access and modification times together. On systems where  utimensatW is supported, the modification time is set atomically with nanosecond precision.!If compiled against a version of unix prior to 2.7.0.0, the function would not be able to set timestamps with sub-second resolution. In this case, there would also be loss of precision in the access time.1*Returns the current user's home directory.The directory returned is expected to be writable by the current user, but note that it isn't generally considered good practice to store application-specific data here; use 2 or 3 instead. On Unix, 1 returns the value of the HOMEg environment variable. On Windows, the system is queried for a suitable path; a typical path might be  C:/Users/<user>.The operation may fail with:UnsupportedOperation6 The operating system has no notion of home directory.UL The home directory for the current user does not exist, or cannot be found.2Obtain the paths to special directories for storing user-specific application data, configuration, and cache files, conforming to the  Fhttp://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html XDG Base Directory Specification. Compared with 3f, this function provides a more fine-grained hierarchy as well as greater flexibility for the user.0It also works on Windows, although in that case  and # will map to the same directory.The second argument is usually the name of the application. Since it will be integrated into the path, it must consist of valid path characters.hNote: The directory may not actually exist, in which case you would need to create it with file mode 700% (i.e. only accessible by the owner).n0Return the value of an environment variable, or jJ if there is no such value. (Equivalent to "lookupEnv" from base-4.6.)o Similar to try$ but only catches a specify kind of p" as specified by the predicate.3Obtain the path to a special directory for storing user-specific application data (traditional Unix location). Newer applications may prefer the the XDG-conformant location provided by 2 ( Chttps://github.com/haskell/directory/issues/6#issuecomment-96521020migration guide).The argument is usually the name of the application. Since it will be integrated into the path, it must consist of valid path characters."On Unix-like systems, the path is ~/.<app>.On Windows, the path is  %APPDATA%/<app> (e.g.  C:/Users/<user>/AppData/Roaming/<app>)Note: the directory may not actually exist, in which case you would need to create it. It is expected that the parent directory exists and is writable.The operation may fail with:UnsupportedOperationU The operating system has no notion of application-specific data directory.UV The home directory for the current user does not exist, or cannot be found.4.Returns the current user's document directory.The directory returned is expected to be writable by the current user, but note that it isn't generally considered good practice to store application-specific data here; use 2 or 3 instead. On Unix, 4 returns the value of the HOMEg environment variable. On Windows, the system is queried for a suitable path; a typical path might be  C:/Users/<user> /Documents.The operation may fail with:UnsupportedOperation: The operating system has no notion of document directory.UP The document directory for the current user does not exist, or cannot be found.52Returns the current directory for temporary files. On Unix, 5 returns the value of the TMPDIR environment variable or "/tmp" if the variable isn't defined. On Windows, the function checks for the existence of environment variables in the following order and uses the first path found:TMP environment variable.TEMP environment variable.!USERPROFILE environment variable.The Windows directoryThe operation may fail with:UnsupportedOperation; The operating system has no notion of temporary directory.4The function doesn't verify whether the path exists.UPQRSq rCreate its parents too?*The path to the directory you want to makeYZ[Source filenameDestination filename\Source filenameDestination filename]Source filenameDestination filename Post-action^Destination file Post-action Main action_` Source fileDestination handlea Source handleDestination handle Source fileDestination filestuvwcdf g!"#h$k%&'()Directory to execute inAction to be executed*+,-.xy/0z12which special directoryWa relative path that is appended to the path; if empty, the base path is returnedno{3/a relative path that is appended to the path456   !"#$%&'()*+,-./012345:&%'()12345 !"#$+*,  -./0JPQRSq rYZ[\]^_`astuvwcdf g!"#h$k%&'()*+,-.xy/0z12no{345|  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVVWXYZ[\]^_`ab`ac`ad`efghijklmnopqrstuvwstxyz{`|}`|~ghgh`e(directory-1.2.6.2-5tqOl7uuNOw8EvNQ8XGXk9System.Directory!System.Directory.Internal.WindowsSystem.Directory.Internal.Posix%System.Directory.Internal.C_utimensat System.Directory.Internal.ConfigSystem.Directory.InternalSystem.Process createProcess Data.FoldableasumControl.Monad.Trans.MaybeMaybeT exeExtension XdgDirectoryXdgData XdgConfigXdgCache Permissionsreadablewritable executable searchableemptyPermissionssetOwnerReadablesetOwnerWritablesetOwnerExecutablesetOwnerSearchablegetPermissionssetPermissionscopyPermissionscreateDirectorycreateDirectoryIfMissingremoveDirectoryremoveDirectoryRecursive removeFilerenameDirectory renameFilecopyFilecopyFileWithMetadatacanonicalizePath makeAbsolutemakeRelativeToCurrentDirectoryfindExecutablefindExecutablesfindExecutablesInDirectoriesfindFile findFiles findFileWith findFilesWithgetDirectoryContents listDirectorygetCurrentDirectorysetCurrentDirectorywithCurrentDirectorydoesDirectoryExist doesFileExistisSymbolicLink getAccessTimegetModificationTime setAccessTimesetModificationTimegetHomeDirectorygetXdgDirectorygetAppUserDataDirectorygetUserDocumentsDirectorygetTemporaryDirectory$fEqPermissions$fOrdPermissions$fReadPermissions$fShowPermissions$fEnumDirectoryType$fEqDirectoryType$fOrdDirectoryType$fReadDirectoryType$fShowDirectoryType$fBoundedXdgDirectory$fEnumXdgDirectory$fEqXdgDirectory$fOrdXdgDirectory$fReadXdgDirectory$fShowXdgDirectory c_realpathc_free c_PATH_MAX withRealpath CTimeSpec c_utimensat c_AT_FDCWD utimeOmit toCTimeSpec$fStorableCTimeSpec DirectoryType NotDirectory Directory DirectoryLinkbaseSystem.IO.ErrorisPermissionErrorisDoesNotExistErrorisAlreadyExistsErrorGHC.IO.ExceptionInappropriateTypeghc-prim GHC.TypesTruegetDirectoryTyperemovePathRecursiveremoveContentsRecursivecopyFileContentsatomicCopyFileContentswithReplacementFileignoreIOExceptionscopyFileToHandlecopyHandleDatafilepath-1.4.1.0System.FilePath.Posix normaliseprependCurrentDirectorymatchTrailingSeparator makeRelativegetPath isExecutable asumMaybeTGHC.BaseJustNothingfindFileWithInIOFalse lookupEnvtryIOErrorTypeIOErrorcopyPermissionsFromStatuscopyMetadataFromStatustryCopyOwnerAndGroupFromStatuscopyOwnerFromStatuscopyGroupFromStatuscopyFileTimesFromStatus getFileTimesfileTimesFromStatus setFileTimesspecializeErrorString