Packages

  • package root
    Definition Classes
    root
  • package fs2
    Definition Classes
    root
  • package io

    Provides various ways to work with streams that perform IO.

    Provides various ways to work with streams that perform IO.

    Definition Classes
    fs2
  • package file

    Provides support for working with files.

    Provides support for working with files.

    Definition Classes
    io
  • FileHandle
  • Files
  • ReadCursor
  • SyncFiles
  • WriteCursor
  • package tcp

    Provides support for TCP networking.

    Provides support for TCP networking.

    Definition Classes
    io
  • package tls
    Definition Classes
    io
  • package udp

    Provides support for UDP networking.

    Provides support for UDP networking.

    Definition Classes
    io
p

fs2.io

file

package file

Provides support for working with files.

Source
file.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. file
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. trait FileHandle[F[_]] extends AnyRef

    Provides the ability to read/write/lock/inspect a file in the effect F.

  2. trait Files[F[_]] extends SyncFiles[F]

    Provides operations related to working with files in the effect F.

    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.

  3. final case class ReadCursor[F[_]](file: FileHandle[F], offset: Long) extends Product with Serializable

    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.

  4. sealed trait SyncFiles[F[_]] extends AnyRef

    Provides basic capabilities related to working with files.

    Provides basic capabilities related to working with files.

    Normally, the Files capability should be used instead, which extends this trait with a few additional operations. SyncFiles[F] provides operations that only require synchronous effects -- * e.g., SyncFiles[SyncIO] has an instance whereas Files[SyncIO] does not.

  5. final case class WriteCursor[F[_]](file: FileHandle[F], offset: Long) extends Product with Serializable

    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.

Value Members

  1. object FileHandle
  2. object Files
  3. object ReadCursor extends Serializable
  4. object SyncFiles
  5. object WriteCursor extends Serializable

Deprecated Value Members

  1. def copy[F[_]](source: Path, target: Path, flags: Seq[CopyOption] = Seq.empty)(implicit arg0: Sync[F]): F[Path]

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].copy

  2. def createDirectories[F[_]](path: Path, flags: Seq[FileAttribute[_]] = Seq.empty)(implicit arg0: Sync[F]): F[Path]

    Creates a new directory at the given path and creates all nonexistent parent directories beforehand.

    Creates a new directory at the given path and creates all nonexistent parent directories beforehand.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].createDirectories

  3. def createDirectory[F[_]](path: Path, flags: Seq[FileAttribute[_]] = Seq.empty)(implicit arg0: Sync[F]): F[Path]

    Creates a new directory at the given path

    Creates a new directory at the given path

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].createDirectory

  4. def delete[F[_]](path: Path)(implicit arg0: Sync[F]): F[Unit]

    Deletes a file.

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].delete

  5. def deleteDirectoryRecursively[F[_]](path: Path, options: Set[FileVisitOption] = Set.empty)(implicit arg0: Sync[F]): F[Unit]

    Recursively delete a directory

    Recursively delete a directory

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].deleteDirectoryRecursively

  6. def deleteIfExists[F[_]](path: Path)(implicit arg0: Sync[F]): F[Boolean]

    Like delete, but will not fail when the path doesn't exist.

    Like delete, but will not fail when the path doesn't exist.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].deleteIfExists

  7. def directoryStream[F[_]](path: Path, glob: String)(implicit arg0: Sync[F]): Stream[F, Path]

    Creates a stream of Paths inside a directory which match the given glob.

    Creates a stream of Paths inside a directory which match the given glob.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].directoryStream

  8. def directoryStream[F[_]](path: Path, filter: (Path) => Boolean)(implicit arg0: Sync[F]): Stream[F, Path]

    Creates a stream of Paths inside a directory, filtering the results by the given predicate.

    Creates a stream of Paths inside a directory, filtering the results by the given predicate.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].directoryStream

  9. def directoryStream[F[_]](path: Path)(implicit arg0: Sync[F]): Stream[F, Path]

    Creates a stream of Paths inside a directory.

    Creates a stream of Paths inside a directory.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].directoryStream

  10. def exists[F[_]](path: Path, flags: Seq[LinkOption] = Seq.empty)(implicit arg0: Sync[F]): F[Boolean]

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].exists

  11. def move[F[_]](source: Path, target: Path, flags: Seq[CopyOption] = Seq.empty)(implicit arg0: Sync[F]): F[Path]

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].move

  12. def permissions[F[_]](path: Path, flags: Seq[LinkOption] = Seq.empty)(implicit arg0: Sync[F]): F[Set[PosixFilePermission]]

    Get file permissions as set of PosixFilePermission

    Get file permissions as set of PosixFilePermission

    This will only work for POSIX supporting file systems

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].permissions

  13. def readAll[F[_]](path: Path, chunkSize: Int)(implicit arg0: Sync[F]): Stream[F, Byte]
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].readAll

  14. def readRange[F[_]](path: Path, chunkSize: Int, start: Long, end: Long)(implicit arg0: Sync[F]): Stream[F, Byte]

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].readRange

  15. def setPermissions[F[_]](path: Path, permissions: Set[PosixFilePermission])(implicit arg0: Sync[F]): F[Path]

    Set file permissions from set of PosixFilePermission

    Set file permissions from set of PosixFilePermission

    This will only work for POSIX supporting file systems

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].setPermissions

  16. def size[F[_]](path: Path)(implicit arg0: Sync[F]): F[Long]

    Returns the size of a file (in bytes).

    Returns the size of a file (in bytes).

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].size

  17. def tail[F[_]](path: Path, chunkSize: Int, offset: Long = 0L, pollDelay: FiniteDuration = 1.second)(implicit arg0: Async[F]): Stream[F, Byte]

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].tail

  18. def tempDirectoryResource[F[_]](dir: Path, prefix: String = "", attributes: Seq[FileAttribute[_]] = Seq.empty)(implicit arg0: Sync[F]): Resource[F, Path]

    Creates a resource containing the path of a temporary directory.

    Creates a resource containing the path of a temporary directory.

    The temporary directory is removed during the resource release.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].tempDirectory

  19. def tempDirectoryStream[F[_]](dir: Path, prefix: String = "", attributes: Seq[FileAttribute[_]] = Seq.empty)(implicit arg0: Sync[F]): Stream[F, Path]

    Creates a stream containing the path of a temporary directory.

    Creates a stream containing the path of a temporary directory.

    The temporary directory is removed when the stream completes.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Stream.resource(SyncFiles[F].tempDirectory(..))

  20. def tempFileResource[F[_]](dir: Path, prefix: String = "", suffix: String = ".tmp", attributes: Seq[FileAttribute[_]] = Seq.empty)(implicit arg0: Sync[F]): Resource[F, Path]

    Creates a resource containing the path of a temporary file.

    Creates a resource containing the path of a temporary file.

    The temporary file is removed during the resource release.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].tempFile

  21. def tempFileStream[F[_]](dir: Path, prefix: String = "", suffix: String = ".tmp", attributes: Seq[FileAttribute[_]] = Seq.empty)(implicit arg0: Sync[F]): Stream[F, Path]

    Creates a stream containing the path of a temporary file.

    Creates a stream containing the path of a temporary file.

    The temporary file is removed when the stream completes.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Stream.resource(Files[F].tempFile(..))

  22. def walk[F[_]](start: Path, maxDepth: Int, options: Seq[FileVisitOption] = Seq.empty)(implicit arg0: Sync[F]): Stream[F, Path]

    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 down to a given depth.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].walk

  23. def walk[F[_]](start: Path, options: Seq[FileVisitOption])(implicit arg0: Sync[F]): Stream[F, Path]

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].walk

  24. def walk[F[_]](start: Path)(implicit arg0: Sync[F]): Stream[F, Path]

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].walk

  25. def watch[F[_]](path: Path, types: Seq[EventType] = Nil, modifiers: Seq[Modifier] = Nil, pollTimeout: FiniteDuration = 1.second)(implicit F: Async[F]): Stream[F, Event]

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].watch

  26. def watcher[F[_]](implicit F: Async[F]): Resource[F, Watcher[F]]

    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().

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].watcher

  27. def writeAll[F[_]](path: Path, flags: Seq[StandardOpenOption] = List(StandardOpenOption.CREATE))(implicit arg0: Sync[F]): Pipe[F, Byte, INothing]

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].writeAll

  28. def writeRotate[F[_]](computePath: F[Path], limit: Long, flags: Seq[StandardOpenOption] = List(StandardOpenOption.CREATE))(implicit F: Async[F]): Pipe[F, Byte, INothing]

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use Files[F].writeRotate

Inherited from AnyRef

Inherited from Any

Ungrouped