ReadFiles

sealed trait ReadFiles[F[_]]

Platform-agnostic methods for reading files.

Companion
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def readAll(path: Path, chunkSize: Int): Stream[F, Byte]

Reads all data from the file at the specified path.

Reads all data from the file at the specified path.

def readCursor(path: Path): Resource[F, ReadCursor[F]]

Returns a ReadCursor for the specified path.

Returns a ReadCursor for the specified path.

def readRange(path: Path, chunkSize: Int, start: Long, end: Long): Stream[F, Byte]

Reads a range of data synchronously from the file at the specified path. start is inclusive, end is exclusive, so when start is 0 and end is 2, two bytes are read.

Reads a range of data synchronously from the file at the specified path. start is inclusive, end is exclusive, so when start is 0 and end is 2, two bytes are read.

def tail(path: Path, chunkSize: Int, offset: Long, pollDelay: FiniteDuration): 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 pollDuration for additional updates to the file.

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.