fs2.io.file
package fs2.io.file
Type members
Classlikes
Provides operations related to working with files in the effect
F
.An instance is available for any effect
F
which has an Async[F]
instance.- Companion
- object
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.
a chunk at a time. Convenience methods are provided for working with pulls.
- Companion
- object
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.
a chunk at a time. Convenience methods are provided for working with pulls.
- Companion
- object
Value members
Methods
@deprecated("Use Files[F].copy", "3.0.0")
def copy[F <: ([_$11] =>> Any)](source: Path, target: Path, flags: Seq[CopyOption])(evidence$8: Async[F]): F[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.
@deprecated("Use Files[F].createDirectories", "3.0.0")
def createDirectories[F <: ([_$22] =>> Any)](path: Path, flags: Seq[FileAttribute[]])(evidence$19: Async[F]): F[Path]
Creates a new directory at the given path and creates all nonexistent parent directories beforehand.
@deprecated("Use Files[F].createDirectory", "3.0.0")
def createDirectory[F <: ([_$21] =>> Any)](path: Path, flags: Seq[FileAttribute[]])(evidence$18: Async[F]): F[Path]
Creates a new directory at the given path
@deprecated("Use Files[F].delete", "3.0.0")
Deletes a file.
If the file is a directory then the directory must be empty for this action to succeed.
This action will fail if the path doesn't exist.
This action will fail if the path doesn't exist.
@deprecated("Use Files[F].deleteDirectoryRecursively", "3.0.0")
def deleteDirectoryRecursively[F <: ([_$14] =>> Any)](path: Path, options: Set[FileVisitOption])(evidence$11: Async[F]): F[Unit]
Recursively delete a directory
@deprecated("Use Files[F].deleteIfExists", "3.0.0")
Like
delete
, but will not fail when the path doesn't exist.@deprecated("Use Files[F].directoryStream", "3.0.0")
def directoryStream[F <: ([_$24] =>> Any)](path: Path, filter: Path => Boolean)(evidence$21: Async[F]): Stream[F, Path]
Creates a stream of Paths inside a directory, filtering the results by the given predicate.
@deprecated("Use Files[F].directoryStream", "3.0.0")
def directoryStream[F <: ([_$25] =>> Any)](path: Path, glob: String)(evidence$22: Async[F]): Stream[F, Path]
Creates a stream of Paths inside a directory which match the given glob.
@deprecated("Use Files[F].exists", "3.0.0")
def exists[F <: ([_$8] =>> Any)](path: Path, flags: Seq[LinkOption])(evidence$5: Async[F]): F[Boolean]
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.
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.
@deprecated("Use Files[F].move", "3.0.0")
def move[F <: ([_$16] =>> Any)](source: Path, target: Path, flags: Seq[CopyOption])(evidence$13: Async[F]): F[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.
@deprecated("Use Files[F].permissions", "3.0.0")
def permissions[F <: ([_$9] =>> Any)](path: Path, flags: Seq[LinkOption])(evidence$6: Async[F]): F[Set[PosixFilePermission]]
Get file permissions as set of PosixFilePermission
This will only work for POSIX supporting file systems
@deprecated("Use Files[F].readAll", "3.0.0")
def readAll[F <: ([_$1] =>> Any)](path: Path, chunkSize: Int)(evidence$1: Async[F]): Stream[F, Byte]
@deprecated("Use Files[F].readRange", "3.0.0")
def readRange[F <: ([_$2] =>> Any)](path: Path, chunkSize: Int, start: Long, end: Long)(evidence$2: Async[F]): Stream[F, Byte]
Reads a range of data synchronously from the file at the specified
two bytes are read.
java.nio.file.Path
.start
is inclusive, end
is exclusive, so when start
is 0 and end
is 2,two bytes are read.
@deprecated("Use Files[F].setPermissions", "3.0.0")
def setPermissions[F <: ([_$10] =>> Any)](path: Path, permissions: Set[PosixFilePermission])(evidence$7: Async[F]): F[Path]
Set file permissions from set of PosixFilePermission
This will only work for POSIX supporting file systems
@deprecated("Use Files[F].tail", "3.0.0")
def tail[F <: ([_$3] =>> Any)](path: Path, chunkSize: Int, offset: Long, pollDelay: FiniteDuration)(evidence$3: Async[F]): Stream[F, Byte]
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
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.
but smaller chunks may occur.
If an error occurs while reading from the file, the overall stream fails.
@deprecated("Use Files[F].tempDirectory", "3.0.0")
def tempDirectoryResource[F <: ([_$20] =>> Any)](dir: Path, prefix: String, attributes: Seq[FileAttribute[]])(evidence$17: Async[F]): Resource[F, Path]
Creates a resource containing the path of a temporary directory.
The temporary directory is removed during the resource release.
@deprecated("Use Stream.resource(Files[F].tempDirectory(..))", "3.0.0")
def tempDirectoryStream[F <: ([_$19] =>> Any)](dir: Path, prefix: String, attributes: Seq[FileAttribute[]])(evidence$16: Async[F]): Stream[F, Path]
Creates a stream containing the path of a temporary directory.
The temporary directory is removed when the stream completes.
@deprecated("Use Files[F].tempFile", "3.0.0")
def tempFileResource[F <: ([_$18] =>> Any)](dir: Path, prefix: String, suffix: String, attributes: Seq[FileAttribute[]])(evidence$15: Async[F]): Resource[F, Path]
Creates a resource containing the path of a temporary file.
The temporary file is removed during the resource release.
@deprecated("Use Stream.resource(Files[F].tempFile(..))", "3.0.0")
def tempFileStream[F <: ([_$17] =>> Any)](dir: Path, prefix: String, suffix: String, attributes: Seq[FileAttribute[]])(evidence$14: Async[F]): Stream[F, Path]
Creates a stream containing the path of a temporary file.
The temporary file is removed when the stream completes.
@deprecated("Use Files[F].walk", "3.0.0")
Creates a stream of Paths contained in a given file tree. Depth is unlimited.
@deprecated("Use Files[F].walk", "3.0.0")
def walk[F <: ([_$27] =>> Any)](start: Path, options: Seq[FileVisitOption])(evidence$24: Async[F]): Stream[F, Path]
Creates a stream of Paths contained in a given file tree, respecting the supplied options. Depth is unlimited.
@deprecated("Use Files[F].walk", "3.0.0")
def walk[F <: ([_$28] =>> Any)](start: Path, maxDepth: Int, options: Seq[FileVisitOption])(evidence$25: Async[F]): Stream[F, Path]
Creates a stream of Paths contained in a given file tree down to a given depth.
@deprecated("Use Files[F].watch", "3.0.0")
def watch[F <: ([_$7] =>> Any)](path: Path, types: Seq[EventType], modifiers: Seq[Modifier], pollTimeout: FiniteDuration)(F: Async[F]): Stream[F, Event]
Watches a single path.
Alias for creating a watcher and watching the supplied path, releasing the watcher when the resulting stream is finalized.
@deprecated("Use Files[F].watcher", "3.0.0")
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
watch or register 1 or more paths, and then return
watcher.events()
.@deprecated("Use Files[F].writeAll", "3.0.0")
def writeAll[F <: ([_$4] =>> Any)](path: Path, flags: Seq[StandardOpenOption])(evidence$4: Async[F]): (F, Byte) => INothing
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.@deprecated("Use Files[F].writeRotate", "3.0.0")
def writeRotate[F <: ([_$5] =>> Any)](computePath: F[Path], limit: Long, flags: Seq[StandardOpenOption])(F: Async[F]): (F, Byte) => INothing
Writes all data to a sequence of files, each limited in size to
limit
.The
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.
computePath
operation is used to compute the path of the first fileand 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.