FileHandle

fs2.io.file.FileHandle
See theFileHandle companion object
trait FileHandle[F[_]]

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

Attributes

Companion:
object
Source:
FileHandle.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Abstract methods

def force(metaData: Boolean): F[Unit]

Force any updates for the underlying file to storage.

Force any updates for the underlying file to storage.

Attributes

metaData

If true, also attempts to force file metadata updates to storage.

Source:
FileHandle.scala
def read(numBytes: Int, offset: Long): F[Option[Chunk[Byte]]]

Read the specified number of bytes at a particular offset.

Read the specified number of bytes at a particular offset.

Attributes

numBytes

the number of bytes to read.

offset

the offset from the start of the file.

Returns:

a number of bytes from the file (at most, numBytes in size).

Source:
FileHandle.scala
def size: F[Long]

Report the current size of the file.

Report the current size of the file.

Attributes

Returns:

the size of the file.

Source:
FileHandle.scala
def truncate(size: Long): F[Unit]

Truncate the underlying file to the specified size.

Truncate the underlying file to the specified size.

Attributes

size

the size of the file after truncation.

Source:
FileHandle.scala
def write(bytes: Chunk[Byte], offset: Long): F[Int]

Write the specified bytes at a particular offset.

Write the specified bytes at a particular offset.

Attributes

bytes

the bytes to write to the FileHandle.

offset

the offset at which to write the bytes.

Returns:

the number of bytes written.

Source:
FileHandle.scala