Trait/Object

fs2.io.file

FileHandle

Related Docs: object FileHandle | package file

Permalink

trait FileHandle[F[_]] extends AnyRef

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.

Source
FileHandle.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FileHandle
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract type Lock

    Permalink

    Opaque type representing an exclusive lock on a file.

Abstract Value Members

  1. abstract def force(metaData: Boolean): F[Unit]

    Permalink

    Force any updates for the underlying file to storage.

    Force any updates for the underlying file to storage.

    metaData

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

  2. abstract def lock(position: Long, size: Long, shared: Boolean): F[Lock]

    Permalink

    Acquire a lock on the specified region of the underlying file.

    Acquire a lock on the specified region of the underlying file.

    position

    the start of the region to lock.

    size

    the size of the region to lock.

    shared

    to request a shared lock across process boundaries (may be converted to an exclusive lock on some operating systems).

    returns

    a lock object which can be used to unlock the region.

  3. abstract def lock: F[Lock]

    Permalink

    Acquire an exclusive lock on the underlying file.

    Acquire an exclusive lock on the underlying file.

    returns

    a lock object which can be used to unlock the file.

  4. abstract def read(numBytes: Int, offset: Long): F[Option[Chunk[Byte]]]

    Permalink

    Read the specified number of bytes at a particular offset.

    Read the specified number of bytes at a particular offset.

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

  5. abstract def size: F[Long]

    Permalink

    Report the current size of the file.

    Report the current size of the file.

    returns

    the size of the file.

  6. abstract def truncate(size: Long): F[Unit]

    Permalink

    Truncate the underlying file to the specified size.

    Truncate the underlying file to the specified size.

    size

    the size of the file after truncation.

  7. abstract def tryLock(position: Long, size: Long, shared: Boolean): F[Option[Lock]]

    Permalink

    Attempt to acquire a lock on the specified region of the underlying file.

    Attempt to acquire a lock on the specified region of the underlying file.

    position

    the start of the region to lock.

    size

    the size of the region to lock.

    shared

    to request a shared lock across process boundaries (may be converted to an exclusive lock on some operating systems).

    returns

    if the lock could be acquired, a lock object which can be used to unlock the region.

  8. abstract def tryLock: F[Option[Lock]]

    Permalink

    Attempt to acquire an exclusive lock on the underlying file.

    Attempt to acquire an exclusive lock on the underlying file.

    returns

    if the lock could be acquired, a lock object which can be used to unlock the file.

  9. abstract def unlock(lock: Lock): F[Unit]

    Permalink

    Unlock the (exclusive or regional) lock represented by the supplied Lock.

    Unlock the (exclusive or regional) lock represented by the supplied Lock.

    lock

    the lock object which represents the locked file or region.

  10. abstract def write(bytes: Chunk[Byte], offset: Long): F[Int]

    Permalink

    Write the specified bytes at a particular offset.

    Write the specified bytes at a particular offset.

    bytes

    the bytes to write to the FileHandle.

    offset

    the offset at which to write the bytes.

    returns

    the number of bytes written.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from FileHandle[F] to any2stringadd[FileHandle[F]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (FileHandle[F], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from FileHandle[F] to ArrowAssoc[FileHandle[F]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def ensuring(cond: (FileHandle[F]) ⇒ Boolean, msg: ⇒ Any): FileHandle[F]

    Permalink
    Implicit information
    This member is added by an implicit conversion from FileHandle[F] to Ensuring[FileHandle[F]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (FileHandle[F]) ⇒ Boolean): FileHandle[F]

    Permalink
    Implicit information
    This member is added by an implicit conversion from FileHandle[F] to Ensuring[FileHandle[F]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: ⇒ Any): FileHandle[F]

    Permalink
    Implicit information
    This member is added by an implicit conversion from FileHandle[F] to Ensuring[FileHandle[F]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): FileHandle[F]

    Permalink
    Implicit information
    This member is added by an implicit conversion from FileHandle[F] to Ensuring[FileHandle[F]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from FileHandle[F] to StringFormat[FileHandle[F]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  23. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. def [B](y: B): (FileHandle[F], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from FileHandle[F] to ArrowAssoc[FileHandle[F]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from FileHandle[F] to any2stringadd[FileHandle[F]]

Inherited by implicit conversion StringFormat from FileHandle[F] to StringFormat[FileHandle[F]]

Inherited by implicit conversion Ensuring from FileHandle[F] to Ensuring[FileHandle[F]]

Inherited by implicit conversion ArrowAssoc from FileHandle[F] to ArrowAssoc[FileHandle[F]]

Ungrouped