Provides the ability to read/write/lock/inspect a file in the effect F
.
Provides the ability to read/write/lock/inspect a file in the effect F
.
To construct a FileHandle
, use the methods in the fs2.io.file.pulls object.
Associates a FileHandle
with an offset in to the file.
Associates a FileHandle
with an offset in to the file.
This encapsulates the pattern of incrementally reading bytes in from a file, a chunk at a time. Convenience methods are provided for working with pulls.
Associates a FileHandle
with an offset in to the file.
Associates a FileHandle
with an offset in to the file.
This encapsulates the pattern of incrementally writing bytes in to a file, a chunk at a time. Convenience methods are provided for working with pulls.
Copies a file from the source to the target path,
Copies a file from the source to the target path,
By default, the copy fails if the target file already exists or is a symbolic link.
Creates a new directory at the given path and creates all nonexistent parent directories beforehand.
Creates a new directory at the given path
Deletes a file.
Deletes a file.
If the file is a directory then the directory must be empty for this action to succed. This action will fail if the path doesn't exist.
Like delete
, but will not fail when the path doesn't exist.
Creates a stream of Paths inside a directory which match the given glob.
Creates a stream of Paths inside a directory, filtering the results by the given predicate.
Creates a stream of Paths inside a directory.
Checks if a file exists
Checks if a file exists
Note that the result of this method is immediately outdated. If this method indicates the file exists then there is no guarantee that a subsequence access will succeed. Care should be taken when using this method in security sensitive applications.
Moves (or renames) a file from the source to the target path.
Moves (or renames) a file from the source to the target path.
By default, the move fails if the target file already exists or is a symbolic link.
Reads all data synchronously from the file at the specified java.nio.file.Path
.
Reads a range of data synchronously from the file at the specified java.nio.file.Path
.
Reads a range of data synchronously from the file at the specified java.nio.file.Path
.
start
is inclusive, end
is exclusive, so when start
is 0 and end
is 2,
two bytes are read.
Returns the size of a file (in bytes).
Returns an infinite stream of data from the file at the specified path.
Returns an infinite stream of data from the file at the specified path.
Starts reading from the specified offset and upon reaching the end of the file,
polls every pollDuration
for additional updates to the file.
Read operations are limited to emitting chunks of the specified chunk size but smaller chunks may occur.
If an error occurs while reading from the file, the overall stream fails.
Creates a stream of Paths contained in a given file tree down to a given depth.
Creates a stream of Paths contained in a given file tree, respecting the supplied options.
Creates a stream of Paths contained in a given file tree, respecting the supplied options. Depth is unlimited.
Creates a stream of Paths contained in a given file tree.
Creates a stream of Paths contained in a given file tree. Depth is unlimited.
Watches a single path.
Watches a single path.
Alias for creating a watcher and watching the supplied path, releasing the watcher when the resulting stream is finalized.
Creates a Watcher for the default file system.
Creates a Watcher for the default file system.
The watcher is returned as a resource. To use the watcher, lift the resource to a stream,
watch or register 1 or more paths, and then return watcher.events()
.
Writes all data to the file at the specified java.nio.file.Path
.
Writes all data to the file at the specified java.nio.file.Path
.
Adds the WRITE flag to any other OpenOption
flags specified. By default, also adds the CREATE flag.
Writes all data to a sequence of files, each limited in size to limit
.
Writes all data to a sequence of files, each limited in size to limit
.
The computePath
operation is used to compute the path of the first file
and every subsequent file. Typically, the next file should be determined
by analyzing the current state of the filesystem -- e.g., by looking at all
files in a directory and generating a unique name.
Provides various Pull
s for working with files.
Provides various Pull
s for working with files.
(Since version 2.1.0) Use ReadCursor/WriteCursor instead
Provides support for working with files.