Files
hpath/hpath.haddock

187 lines
114 KiB
Plaintext
Raw Normal View History

<0C><><01><><01>~<7E> 
    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~<00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00>SafeReturns True<02> if posix-paths was compiled with support for the provided
2016-06-01 14:52:48 +02:00
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
2016-06-01 14:52:48 +02:00
compiled into your version of posix-paths. (If not, using oCloexec will
throw an exception.)

 
   
<00> 2016 Julian OspaldBSD3"Julian Ospald <hasufell@posteo.de> experimentalportableSafeF*Open and optionally create this file. See  $
2016-06-01 14:52:48 +02:00
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).<00><00>status flags of open(2)Just xJ => creates the file with the given modes, Nothing => the file must exist.<00><00><00> 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 " .
2016-06-01 14:52:48 +02:00
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 <00>s in the $PATH variable.(Split a <00># 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 <00>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 <00>dropExtension "file.exe""file"dropExtension "file""file"!dropExtension "/path/file.tar.gz""/path/file.tar",Add an extension to a <00>addExtension "file" ".exe"
"file.exe"addExtension "file.tar" ".gz" "file.tar.gz"addExtension "/path/" ".ext" "/path/.ext"- Check if a <00> has an extensionhasExtension "file"FalsehasExtension "file.tar"TruehasExtension "/path.part1/"False.Operator version of ,/Split a <00> on the first extension.#splitExtensions "/path/file.tar.gz"("/path/file",".tar.gz")<\path -> uncurry addExtension (splitExtensions path) == path0Remove all extensions from a <00>"dropExtensions "/path/file.tar.gz" "/path/file"1Take all extensions from a <00>"takeExtensions "/path/file.tar.gz" ".tar.gz"22Drop the given extension from a FilePath, and the "." preceding it.
Returns <00>8 if the FilePath does not have the given extension, or
<00>. and the part before the extension if it does.+This function can be more predictable than 03,
2016-06-01 14:52:48 +02:00
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)3Split a <00> 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) == "./"4Get the file nametakeFileName "path/file.txt"
"file.txt"takeFileName "path/"""5Change the file name9\path -> replaceFileName path (takeFileName path) == path6Drop the file namedropFileName "path/file.txt""path/"dropFileName "file.txt""./"7/Get the file name, without a trailing extensiontakeBaseName "path/file.tar.gz"
"file.tar"takeBaseName """"8Change the base name(replaceBaseName "path/file.tar.gz" "bob" "path/bob.gz"9\path -> replaceBaseName path (takeBaseName path) == path9BGet 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 <00>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"?Like =, but without trailing slashes$splitDirectories "/path/to/file.txt"["/","path","to","file.txt"]splitDirectories ""[]@!Check if the last character of a <00> is <00>.!hasTrailingPathSeparator "/path/"TruehasTrailingPathSeparator "/"True hasTrailingPathSeparator "/path"FalseAAdd a trailing path separator. addTrailingPathSeparator "/path""/path/"!addTrailingPathSeparator "/path/""/path/"ad
2016-06-01 14:52:48 +02:00
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) xEbEquality 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 pFCheck if a path is relative+\path -> isRelative path /= isAbsolute pathGCheck if a path is absoluteisAbsolute "/path"TrueisAbsolute "path"False isAbsolute ""FalseH:Is a FilePath valid, i.e. could you create a file like it?
isValid ""False isValid "\0"FalseisValid "/random_ path:*"TrueIKTake 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)J@Is the given path a valid filename? This includes
"." and "..".isFileName "lal"TrueisFileName "."TrueisFileName ".."True isFileName ""FalseisFileName "\0"FalseisFileName "/random_ path:*"FalseK7Check if the filepath has any parent directories in it.hasParentDir "/.."TruehasParentDir "foo/bar/.."TruehasParentDir "foo/../bar/."TruehasParentDir "foo/bar"FalsehasParentDir "foo"FalsehasParentDir ""FalsehasParentDir ".."FalseL"Whether the file is a hidden file.hiddenFile ".foo"TruehiddenFile "..foo.bar"TruehiddenFile "some/path/.bar"TruehiddenFile "..."TruehiddenFile "dod.bar"FalsehiddenFile "."FalsehiddenFile ".."False hiddenFile ""False<00>0Combine two paths, assuming rhs is NOT absolute./ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL<00><00>;<00><00><00><00><00><00><00><00><00><00><00><00><00><00> !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL- !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL/ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL<00><00><00> 2016 Julian OspaldBSD3"Julian Ospald <hasufell@posteo.de> experimentalportableNone FMM6Get all files from a directory and its su
2016-06-01 14:52:48 +02:00
strictly. However the returned list is lazy in that directories will only
be accessed on demand.)Follows symbolic links for the input dir.N?Get all files from a directory and its subdirectories strictly.)Follows symbolic links for the input dir.ORecursively 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.S.Gets all directory contents (not recursively).T Binding to  fdopendir(3).ULike S except for a file descriptor.;To avoid complicated error checks, the file descriptor is
always closed, even if T2 fails. Usually, this
only happens on successful TD and after the directory
2016-06-01 14:52:48 +02:00
stream is closed. Also see the manpage of  fdopendir(3) for
more details.V*return the canonicalized absolute pathname like canonicalizePath, but uses  realpath(3)<00><00><00><00><00><00><00><00>MNO<00>PQRSTU<00>V
MNOPQRSTUV
SUMNORQPTV<00><00><00><00><00><00><00><00>MNO<00>PQRSTU<00>V
Safe+WPath 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.<00>Same as  .The following property holds: x == y "a show x == show y<00>ByteString ordering.The following property holds: 'show x `compare` show y "a x `compare` y<00>ByteString equality.The following property holds: show x == show y "a x == yW<00><00><00><00><00>W<00>W<00><00><00><00><00>+<00> 2015 2016 FP Complete, 2016 Julian Ospald BSD 3 clause"Julian Ospald <hasufell@posteo.de> experimentalportableSafe+ZZ"Exception when parsing a location.[A filename, without any <00>.\$A relative path; one without a root.]An absolute path._@Get a location for an absolute path. Produces a normalised path.Throws: Z,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)Nothing`
2016-06-01 14:52:48 +02:00
path.
Note that filepath may contain any number of ./ but may not consist
solely of ./$. It also may not contain a single ..
anywhere.Throws: Z )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)NothingaAParses a filename. Filenames must not contain slashes.
Excludes <00> and '..'.Throws: Z
2016-06-01 14:52:48 +02:00
'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)Nothingb&Convert any Path to a ByteString type.c.Convert an absolute Path to a ByteString type.d-Convert a relative Path to a ByteString type.eAppend two paths.bThe second argument must always be a relative path, which ensures
2016-06-01 14:52:48 +02:00
that undefinable things like `"abc" <> "/def"` cannot happen.<02>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/"fIStrip directory from path, making it relative to that directory.
2016-06-01 14:52:48 +02:00
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)Nothingg>Is p a parent of the given location? Implemented in terms of
f. 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")FalsehGet all parents of a path.%getAllParents (MkPath "/abs/def/dod")["/abs/def","/abs","/"]getAllParents (MkPath "/")[]i%Extract the directory name of a path.dirname (MkPath "/abc/def/dod")
"/abc/def"dirname (MkPath "/")"/"j Extract the file part of a path.The following properties hold:  basename (p </> a) == basename aThrows: Y if given the root path "/"3basename (MkPath "/abc/def/dod") :: Maybe (Path Fn)
Just "dod"4basename (MkPath "/abc/def/dod/") :: Maybe (Path Fn)
Just "dod"3basename (MkPath "/") :: Maybe (Path Fn)Nothing XY<00>Z<00><00><00><00>[\]^_`abcdefghijklm<00><00><00><00><00>WXYZ[\]^_`abcdefghijklm]W\[ZYX^_a`cdbejighfklmXY<00>Z<00><00><00><00>[\]^_`abcdefghijklm<00><00><00><00><00><00> 2016 Julian OspaldBSD3"Julian Ospald <hasufell@posteo.de> experimentalportableNone+No<02>A 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.tJAdditional generic IO exceptions that the posix functions
do not provide.Throws  AlreadyExists <00> if file exists.<00>Throws  AlreadyExists <00> if directory exists.<00>Uses x and throws u if it returns True.<00>^Check if the files are the same by examining device and file id.
This follows symbolic links.<00><02>Checks whether the destination directory is contained
2016-06-01 14:52:48 +02:00
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.<00>RChecks if the given file exists and is not a directory.
Does not follow symlinks.<00>NChecks if the given file exists and is a directory.
Does not follow symlinks.<00>,Checks whether a file or folder is writable.<00>WChecks whether the directory at the given path exists and can be
opened. This invokes  openDirStream which follows symlinks.<00><02>Carries out an action, then checks if there is an IOException and
2016-06-01 14:52:48 +02:00
a specific errno. If so, then it carries out another action, otherwise
it rethrows the error.<00><02>Execute the given action and retrow IO exceptions as a new Exception
2016-06-01 14:52:48 +02:00
that have the given errno. If errno does not match the exception is rethrown
as is.<00>Like <00>, with arguments swapped.<00>Like <00><02>, but allows to have different clean-up
2016-06-01 14:52:48 +02:00
actions depending on whether the in-between computation
has raised an exception or not. opqrstuvw<00>xyz{|}~<00><00><00><00>
source dirfull destination,  dirname dest
must exist<00><00><00><00><00>errno to catch-action to try, which can raise an IOExceptionEaction to carry out in case of an IOException and
if errno matches<00>errno to catchrethrow as if errno matches action to try<00><00>computation to run first8computation to run last, when
no exception was raised8computation to run last,
when an exception was raisedcomputation to run in-between<00>reaction on IO errorsreaction on HPathIOException<00>opqrstuvwxyz{|}~<00><00><00><00><00><00><00><00><00><00><00><00><00>tuvwopqrsxyz{|}~<00><00><00><00><00><00><00><00><00><00><00><00><00>opqrstuvw<00>xyz{|}~<00><00><00><00><00><00><00><00><00><00><00><00><00><00><00> 2016 Julian OspaldBSD3"Julian Ospald <hasufell@posteo.de> experimentalportableNoneMnApplies realpath on the given absolute path.Throws:<00>- if the file at the given path does not exist<00> if the symlink is broken<00>sThe mode for copy and file moves.
Overwrite mode is usually not very well defined, but is a convenience
shortcut.<00>fail if any target exists<00>overwrite targets<00>(The error mode for recursive operations.On <00><02> the whole operation fails immediately if any of the
recursive sub-operations fail, which is sort of the default
for IO operations.On <00>` skips errors in the recursion and keeps on recursing.
However all errors are collected in the wN error type,
which is raised finally if there was any error. Also note that
wK does not give any guarantees on the ordering
of the collected exceptions.<00><02>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
DFor directory contents, this will ignore any file type that is not
<00>, <00> or <00>.For <00><02> 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 <00><02> is carried out for the
2016-06-01 14:52:48 +02:00
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:<00># if source directory does not exist<00>$ if source directory can't be openedu4 if source and destination are the same file
(t)v. if destination is contained in source
(t)
Throws in <00> RecursiveErrorMode only:<00>$ if output directory is not writable<00>, if source directory is wrong type (symlink)<00>1 if source directory is wrong type (regular file)
Throws in <00> RecursiveErrorMode only:we if any of the recursive operations that are not
part of the top-directory sanity-checks fail (t)
Throws in <00> CopyMode only:<00> if destination already exists<00>Recreate a symlink.In <00>8 copy mode only files and empty directories are deleted.Safety/reliability concerns:<00> mode is inherently non-atomicThrows:<00>- if source file is wrong type (not a symlink)<00>) if output directory cannot be written to<00>% if source directory cannot be openedu4 if source and destination are the same file
(t)
Throws in <00> mode only:<00> if destination already exists
Throws in <00> mode only:<00>+ if destination file is non-empty directory Note: calls symlink<00><02>Copies the given regular file to the given destination.
2016-06-01 14:52:48 +02:00
Neither follows symbolic links, nor accepts them.
For "copying" symbolic links, use <00> 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 <00>
2016-06-01 14:52:48 +02:00
instead.In <00>9 copy mode only overwrites actual files, not directories.Safety/reliability concerns:<00> mode is not atomic when used on <00>], reads the "contents" and copies
them to a regular file, which might take indefinitely when used on <00><02>, may either read the "contents"
2016-06-01 14:52:48 +02:00
and copy them to a regular file (potentially hanging indefinitely)
or may create a regular empty destination file when used on <00>, will hang indefinitelyThrows:<00> if source file does not exist<00> if source file is a a <00><00>$ if output directory is not writable<00>$ if source directory can't be opened<00>4 if source file is wrong type (symlink or directory)u4 if source and destination are the same file
(t)
Throws in <00> mode only:<00> if destination already exists Note: calls sendfile and possibly <00>/write as fallback<00><02>Copies a regular file, directory or symbolic link. In case of a
2016-06-01 14:52:48 +02:00
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 <00> for directories<00>Deletes the given file. Raises eISDIR8
if run on a directory. Does not follow symbolic links.Throws:<00> for wrong file type (directory)<00> if the file does not exist<00> if the directory cannot be read<00>ADeletes the given directory, which must be empty, never symlinks.Throws:<00>+ for wrong file type (symlink to directory)<00># for wrong file type (regular file)<00> if directory does not exist<00> if directory is not empty<00>. if we can't open or write to parent directory Notes: calls rmdir<00>PDeletes the given directory recursively. Does not follow symbolic
links. Tries <00>/ first before attemtping a recursive
deletion.(On directory contents this behaves like <00>1
and thus will ignore any file type that is not <00>,
<00> or <00>.Safety/reliability concerns:
not atomicexamines filetypes explicitlyThrows:<00>+ for wrong file type (symlink to directory)<00># for wrong file type (regular file)<00> if directory does not exist<00>. if we can't open or write to parent directory<00><02>Deletes a file, directory or symlink.
2016-06-01 14:52:48 +02:00
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 <00> for directories<00>eOpens a file appropriately by invoking xdg-open. The file type
is not checked. This forks a process.<00>BExecutes a program with the given arguments. This forks a process.<00>MCreate an empty regular file at the given directory with the given
filename.Throws:<00>) if output directory cannot be written to<00> if destination already exists<00>? if any of the parent components of the path
do not exist<00>ICreate an empty directory at the given directory with the given filename.Throws:<00>) if output directory cannot be written to<00> if destination already exists<00>? if any of the parent components of the path
do not exist<00><02>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:<00>O if any part of the path components do not
exist and cannot be written to<00>; if destination already exists and
is not a directory<00>Create a symlink.Throws:<00>) if output directory cannot be written to<00># if destination file already exists<00>? if any of the parent components of the path
do not exist Note: calls symlink<00>nRename a given file with the provided filename. Destination and source
must be on the same device, otherwise <00> 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:<00> if source file does not exist<00>) if output directory cannot be written to<00>% if source directory cannot be opened<00>: if source and destination are on different
devices<00> if destination already existsu5 if destination and source are the same file
(t) Note: calls <00>3 (but does not allow to rename over existing files)<00>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:<00> mode is not atomic-copy-delete fallback is inherently non-atomicsince this function calls <00> and <00> as a fallback
to <00>, file types that are not <00>, <00>
2016-06-01 14:52:48 +02:00
or <00> may be ignoredfor <00>L mode, the destination will be deleted (not recursively)
before movingThrows:<00> if source file does not exist<00>) if output directory cannot be written to<00>% if source directory cannot be openedu5 if destination and source are the same file
(t)
Throws in <00> mode only:<00> if destination already exists Note: calls <00>3 (but does not allow to rename over existing files)<00>#Default permissions for a new file.<00>(Default permissions for a new directory.<00>tGets 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:<00> if directory does not exist<00> if file type is wrong (file)<00>( if file type is wrong (symlink to file)<00>' if file type is wrong (symlink to dir)<00> if directory cannot be opened<00>YGet the file type of the file located at the given path. Does
not follow symbolic links.Throws:<00> if the file does not exist<00>* if any part of the path is not accessible$n<00><00><00><00><00><00><00><00><00><00><00><00><00><00><00>
source dir:destination (parent dirs
are not automatically created)<00>the old symlink filedestination file<00> source filedestination file<00> source filedestination file<00><00><00><00><00><00><00>program arguments<00><00><00><00>destination filepath the symlink points to<00><00> file to move destination<00><00><00> dir to read<00>#n<00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00>#<00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00>nn<00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00>    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`
abcdefgahij klFmnopqrstuvwxyz{|}~<00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00>
<00>
<00>
<00>
<00>
<00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00>3Y29RV9jOPF5qxp9K4EbQtSystem.Posix.Directory.ForeignSystem.Posix.FDSystem.Posix.FilePath!System.Posix.Directory.TraversalsHPathHPath.IOHPath.IO.Errors System.PosixFilesHPath.Internal
toFilePathFlagsUnsupportedFlagDirTypeunFlags isSupportedoCloexecdtBlkdtChrdtDirdtFifodtLnkdtRegdtSock dtUnknownoAppendoAsyncoCreat
2016-06-01 14:52:48 +02:00
oDirectoryoExcloNoctty oNofollow oNonblockoRdonlyoWronlyoRdwroSyncoTruncpathMax
unionFlagsopenFd pathSeparatorisPathSeparatorsearchPathSeparatorisSearchPathSeparator extSeparatorisExtSeparatorsplitSearchPath getSearchPathsplitExtension takeExtensionreplaceExtension dropExtension addExtension hasExtension<.>splitExtensionsdropExtensionstakeExtensionsstripExtension splitFileName takeFileNamereplaceFileName dropFileName takeBaseNamereplaceBaseName takeDirectoryreplaceDirectorycombine</> splitPathjoinPathsplitDirectorieshasTrailingPathSeparatoraddTrailingPathSeparatordropTrailingPathSeparator normalise makeRelative equalFilePath
2016-06-01 14:52:48 +02:00
isRelative
isAbsoluteisValid makeValid
isFileName hasParentDir
hiddenFileallDirectoryContentsallDirectoryContents'traverseDirectoryunpackDirStream packDirStream
readDirEntgetDirectoryContents fdOpendirgetDirectoryContents'realpathPathRelC PathExceptionPathParseExceptionFnRelAbsparseAbsparseRelparseFnfromAbsfromRelstripDir
isParentOf getAllParentsdirnamebasename withAbsPath withRelPath
withFnPathcanonicalizePathRecursiveFailureHintReadContentsFailedCreateDirFailedCopyFileFailedRecreateSymlinkFailedHPathIOExceptionSameFileDestinationInSourceRecursiveFailure
isSameFileisDestinationInSourceisRecursiveFailureisReadContentsFailedisCreateDirFailedisCopyFileFailedisRecreateSymlinkFailedthrowFileDoesExistthrowDirDoesExist throwSameFilesameFilethrowDestinationInSource doesFileExistdoesDirectoryExist
isWritablecanOpenDirectory
2016-06-01 14:52:48 +02:00
catchErrnorethrowErrnoAs handleIOError
bracketeer reactOnErrorCopyModeStrict OverwriteRecursiveErrorMode FailEarlyCollectFailuresFileType Directory RegularFile SymbolicLink BlockDeviceCharacterDevice NamedPipeSocketcopyDirRecursiverecreateSymlinkcopyFileeasyCopy
2016-06-01 14:52:48 +02:00
deleteFile deleteDirdeleteDirRecursive
easyDeleteopenFile executeFilecreateRegularFile createDircreateDirRecursive createSymlink
renameFilemoveFile newFilePerms newDirPerms getDirsFiles getFileTypec_openopen_unix_A3WgcI5QiHK4PDo4jSYdwQ System.Posix.ByteString.FilePath RawFilePathbaseGHC.BaseNothingJustGHC.Real/
combineRawsplitFileNameRawthrowErrnoPathIfMinus1_throwErrnoPathIfMinus1throwErrnoPathIfNullthrowErrnoPathIf_throwErrnoPathIfthrowErrnoPaththrowErrnoPathIfRetrythrowErrnoPathIfNullRetrythrowErrnoPathIfMinus1Retry_throwErrnoPathIfMinus1RetrypeekFilePathLen peekFilePath withFilePathCDirentCDir c_fdopendir
2016-06-01 14:52:48 +02:00
c_realpathc_typec_name c_freeDirEnt c_readdiractOnDirContents_dirloop
$fShowPath $fOrdPath$fEqPathMkPath $fNFDataPath.RootDirHasNoBasename
InvalidAbs
InvalidRel InvalidFnCouldn'tStripPrefixTPS stripPrefix$fRelCFn $fRelCRel$fExceptionPathException$fExceptionPathParseExceptionGHC.IO.ExceptionIOErrorSystem.IO.Error catchIOErrorControl.Exception.BasebrackettoConstr$fExceptionHPathIOException NoSuchThingPermissionDeniedInvalidArgumentInappropriateType AlreadyExistsUnsatisfiedConstraints Text.ReadreadForeign.C.ErroreXDEVUnsupportedOperationSystem.Posix.Files.ByteStringrename _copyFile