Module Files

This module is undocumented. This is a list of its definitions.

APPEND :: OpenOption

Writes to the end of the file instead of its beginning.

ATOMIC_MOVE :: CopyOption

Performs the move as an atomic file system operation.

COPY_ATTRIBUTES :: CopyOption

Copies the file attributes of the source file to the target file.

CREATE :: OpenOption

Creates the file if it does not exist.

CREATE_NEW :: OpenOption

Creates a new file, failing if the file already exists.

DELETE_ON_CLOSE :: OpenOption

Deletes the file when the stream is closed.

DSYNC :: OpenOption

Requires that every update of the file content is written synchronously to the underlying storage.

READ :: OpenOption

Opens the file for reading.

REPLACE_EXISTING :: CopyOption

Replaces an existing target file.

SPARSE :: OpenOption

A hint that the file is sparse.

SYNC :: OpenOption

Requires that every update of the file content or metadata is written synchronously to the underlying storage.

TRUNCATE_EXISTING :: OpenOption

Truncates an existing file to zero length before writing to it.

WRITE :: OpenOption

Opens the file for writing.

closeFileSystem :: FileSystem -> <Proc> ()

Closes the given file system. Paths of a closed file system can no longer be used.

copy :: Path -> Path -> <Proc,Exception> Path

copy source target copies the file at source to target and returns target. Fails if target already exists.

copyInputStreamWithCopyOptions :: InputStream -> Path -> Vector CopyOption -> <Proc,Exception> Long

copyInputStreamWithCopyOptions input target options copies all bytes of input to the file at target and returns the number of bytes copied.

copyToOutputStream :: Path -> OutputStream -> <Proc,Exception> Long

copyToOutputStream source output copies all bytes of the file at source to output and returns the number of bytes copied.

copyWithCopyOptions :: Path -> Path -> Vector CopyOption -> <Proc,Exception> Path

copyWithCopyOptions source target options copies the file at source to target and returns target.

createDirectories :: Path -> <Proc,Exception> Path

Creates the directory at the given path, creating also all missing parent directories.

createDirectoriesWithFileAttributes :: Path -> Vector FileAttribute -> <Proc,Exception> Path

Creates the directory at the given path with the given file attributes, creating also all missing parent directories.

createDirectory :: Path -> <Proc,Exception> Path

Creates a new directory at the given path. Fails if the parent directory does not exist.

createDirectoryWithFileAttributes :: Path -> Vector FileAttribute -> <Proc,Exception> Path

Creates a new directory at the given path with the given file attributes. Fails if the parent directory does not exist.

createFile :: Path -> <Proc,Exception> Path

Creates a new empty file at the given path. Fails if the file already exists.

createFileWithFileAttributes :: Path -> Vector FileAttribute -> <Proc,Exception> Path

Creates a new empty file at the given path with the given file attributes. Fails if the file already exists.

createTempFile :: String -> String -> <Proc,Exception> Path

createTempFile prefix suffix creates a new file with the given name prefix and suffix in the default temporary file directory.

createTempFileWithFileAttributes :: String -> String -> Vector FileAttribute -> <Proc,Exception> Path

createTempFileWithFileAttributes prefix suffix attributes creates a new file with the given name prefix and suffix in the default temporary file directory.

delete :: Path -> <Proc,Exception> ()

Deletes the file or the empty directory at the given path. Fails if it does not exist.

deleteIfExists :: Path -> <Proc,Exception> Boolean

Deletes the file or the empty directory at the given path. Returns False if it did not exist.

exists :: Path -> <Proc> Boolean

Returns True if a file exists at the given path. Symbolic links are followed.

existsWithLinkOptions :: Path -> Vector LinkOption -> <Proc> Boolean

Returns True if a file exists at the given path.

getParentPath :: Path -> <Proc> Path

The parent path of the given path, i.e. the path without its last element. The result is null if the path has no parent.

getPathFromFileSystem :: FileSystem -> String -> Vector String -> <Proc> Path

getPathFromFileSystem fs first rest constructs a path of the given file system from the given path string and the additional path elements.

isExecutable :: Path -> <Proc> Boolean

Returns True if the file at the given path exists and is executable.

isReadable :: Path -> <Proc> Boolean

Returns True if the file at the given path exists and is readable.

isWritable :: Path -> <Proc> Boolean

Returns True if the file at the given path exists and is writable.

move :: Path -> Path -> <Proc,Exception> Path

move source target moves or renames the file at source to target and returns target. Fails if target already exists.

moveWithCopyOptions :: Path -> Path -> Vector CopyOption -> <Proc,Exception> Path

moveWithCopyOptions source target options moves or renames the file at source to target and returns target.

newFileSystemFromPath :: Path -> FileSystem

Opens the file at the given path, for example a zip file, as a file system.

newInputStream :: Path -> <Proc,Exception> InputStream

Opens an input stream for reading the file at the given path.

newInputStreamWithOpenOptions :: Path -> Vector OpenOption -> <Proc,Exception> InputStream

Opens an input stream for reading the file at the given path with the given open options.

newOutputStream :: Path -> <Proc,Exception> OutputStream

Opens an output stream for writing the file at the given path. An existing file is truncated.

newOutputStreamWithOpenOptions :: Path -> Vector OpenOption -> <Proc,Exception> OutputStream

Opens an output stream for writing the file at the given path with the given open options.

notExists :: Path -> <Proc> Boolean

Returns True if no file exists at the given path. Symbolic links are followed.

notExistsWithLinkOptions :: Path -> Vector LinkOption -> <Proc> Boolean

Returns True if no file exists at the given path. This is not always the negation of existsWithLinkOptions: both are False when the existence of the file cannot be determined.

path :: String -> Path

Constructs a path from the given path string.

pathToString :: Path -> <Proc> String

The string representation of the given path.

paths :: String -> Vector String -> Path

paths first rest constructs a path from the given path string and the additional path elements.

readAllBytes :: Path -> <Proc,Exception> Vector Byte

Reads the whole contents of the file at the given path.

readAllLines :: Path -> <Proc,Exception> [String]

Reads all lines of the file at the given path, decoding it as UTF-8.

readAllLinesWithCharset :: Path -> Charset -> <Proc,Exception> [String]

Reads all lines of the file at the given path, decoding it with the given charset.

relativizePath :: Path -> Path -> <Proc> Path

relativizePath base other constructs a relative path from base to other.

resolvePath :: Path -> String -> <Proc> Path

resolvePath parent child resolves the given child path string against parent.

size :: Path -> <Proc,Exception> Long

The size of the file at the given path in bytes.

toAbsolutePath :: Path -> <Proc> Path

The given path converted to an absolute path.

write :: Path -> Vector Byte -> Vector OpenOption -> <Proc,Exception> ()

write path bytes options writes the given bytes to the file at path using the given open options.

writeBytesWithOpenOptions :: Path -> Vector Byte -> Vector OpenOption -> <Proc,Exception> Path

Like write, but returns the written path.