Îõ³h$=Ô<$9      !"#$%&'()*+,-./012345678© 2016 Julian OspaldBSD3"Julian Ospald  experimentalportableNone?Ø;’&hpath-ioõCopies 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 ÄFor directory contents, this will ignore any file type that is not  RegularFile,  SymbolicLink or  Directory.For  OverwriteÏ 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 9Ô 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: NoSuchThing# if source directory does not existPermissionDenied$ if source directory can't be opened:4 if source and destination are the same file (;)<. if destination is contained in source (;) Throws in  FailEarly RecursiveErrorMode only:PermissionDenied$ if output directory is not writableInvalidArgument, if source directory is wrong type (symlink)InappropriateType1 if source directory is wrong type (regular file) Throws in CollectFailures RecursiveErrorMode only:=å if any of the recursive operations that are not part of the top-directory sanity-checks fail (;) Throws in Strict CopyMode only: AlreadyExists if destination already existshpath-ioRecreate a symlink.In  Overwrite8 copy mode only files and empty directories are deleted.Safety/reliability concerns: Overwrite mode is inherently non-atomicThrows:InvalidArgument- if source file is wrong type (not a symlink)PermissionDenied) if output directory cannot be written toPermissionDenied% if source directory cannot be opened:4 if source and destination are the same file (;) Throws in Strict mode only: AlreadyExists if destination already exists Throws in  Overwrite mode only:UnsatisfiedConstraints+ if destination file is non-empty directoryNotes:calls symlinkhpath-ioŽCopies the given regular file to the given destination. Neither follows symbolic links, nor accepts them. For "copying" symbolic links, use  instead.ùNote that this is still sort of a low-level function and doesn't examine file types. For a more high-level version, use  instead.In  Overwrite> copy mode only overwrites actual files, not directories. In Strict* mode the destination file must not exist.Safety/reliability concerns: Overwrite mode is not atomic when used on CharacterDeviceÝ, reads the "contents" and copies them to a regular file, which might take indefinitely when used on  BlockDevicež, 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  NamedPipe, will hang indefinitelyThrows: NoSuchThing if source file does not exist NoSuchThing if source file is a a SocketPermissionDenied$ if output directory is not writablePermissionDenied$ if source directory can't be openedInvalidArgument4 if source file is wrong type (symlink or directory):4 if source and destination are the same file (;) Throws in Strict mode only: AlreadyExists if destination already existshpath-io§Copies 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  for directorieshpath-ioDeletes the given file. Raises eISDIR8 if run on a directory. Does not follow symbolic links.Throws:InappropriateType for wrong file type (directory) NoSuchThing if the file does not existPermissionDenied if the directory cannot be read Notes: calls unlinkhpath-ioÁDeletes the given directory, which must be empty, never symlinks.Throws:InappropriateType+ for wrong file type (symlink to directory)InappropriateType# for wrong file type (regular file) NoSuchThing if directory does not existUnsatisfiedConstraints if directory is not emptyPermissionDenied. if we can't open or write to parent directory Notes: calls rmdirhpath-ioÐDeletes the given directory recursively. Does not follow symbolic links. Tries / first before attemtping a recursive deletion.(On directory contents this behaves like 1 and thus will ignore any file type that is not  RegularFile,  SymbolicLink or  Directory.Safety/reliability concerns: not atomicexamines filetypes explicitlyThrows:InappropriateType+ for wrong file type (symlink to directory)InappropriateType# for wrong file type (regular file) NoSuchThing if directory does not existPermissionDenied. if we can't open or write to parent directoryhpath-io®Deletes 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  for directorieshpath-ioåOpens a file appropriately by invoking xdg-open. The file type is not checked. This forks a process.hpath-ioÂExecutes a program with the given arguments. This forks a process.hpath-ioÍCreate an empty regular file at the given directory with the given filename.Throws:PermissionDenied) if output directory cannot be written to AlreadyExists if destination already exists NoSuchThing? if any of the parent components of the path do not existhpath-ioÉCreate an empty directory at the given directory with the given filename.Throws:PermissionDenied) if output directory cannot be written to AlreadyExists if destination already exists NoSuchThing? if any of the parent components of the path do not existhpath-ioÉCreate an empty directory at the given directory with the given filename.Throws:PermissionDenied) if output directory cannot be written to NoSuchThing? if any of the parent components of the path do not existhpath-io£Create 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:PermissionDeniedÏ if any part of the path components do not exist and cannot be written to AlreadyExists= if destination already exists and is *not* a directoryhpath-ioCreate a symlink.Throws:PermissionDenied) if output directory cannot be written to AlreadyExists# if destination file already exists NoSuchThing? if any of the parent components of the path do not exist Note: calls symlinkhpath-ioîRename a given file with the provided filename. Destination and source must be on the same device, otherwise eXDEV will be raised.ÃDoes not follow symbolic links, but renames the symbolic link file.Safety/reliability concerns:Àhas a separate set of exception handling, apart from the syscallThrows: NoSuchThing if source file does not existPermissionDenied) if output directory cannot be written toPermissionDenied% if source directory cannot be openedUnsupportedOperation: if source and destination are on different devices AlreadyExists if destination already exists:5 if destination and source are the same file (;) Note: calls rename3 (but does not allow to rename over existing files) hpath-ioäMove a file. This also works across devices by copy-delete fallback. And also works on directories.ÃDoes not follow symbolic links, but renames the symbolic link file.Safety/reliability concerns: Overwrite mode is not atomic-copy-delete fallback is inherently non-atomicsince this function calls  and  as a fallback to , file types that are not  RegularFile,  SymbolicLink or  Directory may be ignoredfor  OverwriteÌ mode, the destination will be deleted (not recursively) before movingThrows: NoSuchThing if source file does not existPermissionDenied) if output directory cannot be written toPermissionDenied% if source directory cannot be opened:5 if destination and source are the same file (;) Throws in Strict mode only: AlreadyExists if destination already existsNotes:calls rename3 (but does not allow to rename over existing files)!hpath-ioRead the given file lazily.-Symbolic links are followed. File must exist.Throws:InappropriateType+ if file is not a regular file or a symlinkPermissionDeniedà if we cannot read the file or the directory containting it NoSuchThing if the file does not exist"hpath-io)Read the given file strictly into memory.-Symbolic links are followed. File must exist.Throws:InappropriateType+ if file is not a regular file or a symlinkPermissionDeniedà if we cannot read the file or the directory containting it NoSuchThing if the file does not exist#hpath-ioáOpen the given file as a filestream. Once the filestream is exits, the filehandle is cleaned up.Throws:InappropriateType+ if file is not a regular file or a symlinkPermissionDeniedà if we cannot read the file or the directory containting it NoSuchThing if the file does not exist$hpath-ioÖWrite a given ByteString to a file, truncating the file beforehand. Follows symlinks.Throws:InappropriateType+ if file is not a regular file or a symlinkPermissionDeniedà if we cannot read the file or the directory containting it NoSuchThing if the file does not exist%hpath-ioÛWrite a given lazy ByteString to a file, truncating the file beforehand. Follows symlinks.Throws:InappropriateType+ if file is not a regular file or a symlinkPermissionDeniedà if we cannot read the file or the directory containting it NoSuchThing if the file does not exist"Note: uses streamly under the hood&hpath-ioÌAppend a given ByteString to a file. The file must exist. Follows symlinks.Throws:InappropriateType+ if file is not a regular file or a symlinkPermissionDeniedà if we cannot read the file or the directory containting it NoSuchThing if the file does not exist'hpath-io;Checks if the given file exists. Does not follow symlinks.+Only eNOENT is catched (and returns False).(hpath-ioÒChecks if the given file exists and is not a directory. Does not follow symlinks.+Only eNOENT is catched (and returns False).)hpath-ioÎChecks if the given file exists and is a directory. Does not follow symlinks.+Only eNOENT is catched (and returns False).*hpath-io,Checks whether a file or folder is readable.ÂOnly eACCES, eROFS, eTXTBSY, ePERM are catched (and return False).Throws: NoSuchThing if the file does not exist+hpath-io,Checks whether a file or folder is writable.ÂOnly eACCES, eROFS, eTXTBSY, ePERM are catched (and return False).Throws: NoSuchThing if the file does not exist,hpath-io.Checks whether a file or folder is executable.ÂOnly eACCES, eROFS, eTXTBSY, ePERM are catched (and return False).Throws: NoSuchThing if the file does not exist-hpath-io×Checks whether the directory at the given path exists and can be opened. This invokes  openDirStream which follows symlinks.1hpath-ioôGets all filenames of the given directory. This excludes "." and "..". This version does not follow symbolic links.ÆThe contents are not sorted and there is no guarantee on the ordering.Throws: NoSuchThing if directory does not existInappropriateType if file type is wrong (file)InappropriateType( if file type is wrong (symlink to file)InappropriateType' if file type is wrong (symlink to dir)PermissionDenied if directory cannot be opened>8 if a filename could not be parsed (should never happen)2hpath-ioLike 1Æ, but returns the filename only, instead of prepending the base path.3hpath-ioLike 2, except returning a Stream.4hpath-ioÙGet the file type of the file located at the given path. Does not follow symbolic links.Throws: NoSuchThing if the file does not existPermissionDenied* if any part of the path is not accessible5hpath-ioApplies realpath on the given path.Throws: NoSuchThing- if the file at the given path does not exist NoSuchThing if the symlink is broken>- if realpath does not return an absolute path6hpath-ioÊConverts any path to an absolute path. This is done in the following way:6if the path is already an absolute one, just return it.Throws:>Í if the bytestring could neither be parsed as relative or absolute Path8hpath-io2Convenience function to open the path as a handle.4If the file does not exist, it will be created with  newFilePerms.Throws:>Í if the bytestring could neither be parsed as relative or absolute Path hpath-io source dirhpath-io:destination (parent dirs are not automatically created)hpath-iothe old symlink filehpath-iodestination filehpath-io source filehpath-iodestination filehpath-ioprogramhpath-io argumentshpath-iodestination filehpath-iopath the symlink points to hpath-io file to movehpath-io destination$hpath-ioif Nothing, file must exist%hpath-ioif Nothing, file must exist1hpath-io dir to read2hpath-io dir to readÔ   @ABCDE9FGHIJKLMNOP;=:=?=@=A=BCDECDF=G=H=I=J=K=L=M=N=O=P=Q=R=S=T=U=V=W=X=Y=Z=[=\Ý&hpath-io-0.14.2-IRWxtAIYRDQA8W3v2sKtQvHPath.IO-hpath-directory-0.14.2-FOJqf5VUVQHETOtW6yNEEt"System.Posix.RawFilePath.Directory newDirPerms newFilePermsSocket NamedPipeCharacterDevice BlockDevice SymbolicLink RegularFile DirectoryFileTypeCollectFailures FailEarlyRecursiveErrorMode OverwriteStrictCopyModecopyDirRecursiverecreateSymlinkcopyFileeasyCopy deleteFile deleteDirdeleteDirRecursive easyDeleteopenFile executeFilecreateRegularFile createDircreateDirIfMissingcreateDirRecursive createSymlink renameFilemoveFilereadFilereadFileStrictreadFileStream writeFile writeFileL appendFile doesExist doesFileExistdoesDirectoryExist isReadable isWritable isExecutablecanOpenDirectorygetModificationTimesetModificationTimesetModificationTimeHiRes getDirsFiles getDirsFiles'getDirsFilesStream getFileTypecanonicalizePathtoAbswithRawFilePath withHandle)System.Posix.RawFilePath.Directory.ErrorsthrowDestinationInSourceSameFileHPathIOExceptionDestinationInSourceRecursiveFailure#hpath-0.12.0-3GqATcOvWkt721zmlgmsPSHPathPathParseExceptionparseAny reactOnError bracketeer hideError handleIOErrorrethrowErrnoAs catchErrnosameFile throwSameFilethrowDirDoesExistthrowFileDoesExistisRecreateSymlinkFailedisCopyFileFailedisCreateDirFailedisReadContentsFailedisRecursiveFailureisDestinationInSource isSameFileRecursiveFailureHintRecreateSymlinkFailedCopyFileFailedReadContentsFailedCreateDirFailed