Packages

trait FileHandle[F[_]] extends AnyRef

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

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

Type Members

  1. abstract type Lock

    Opaque type representing an exclusive lock on a file.

Abstract Value Members

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

    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]

    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]

    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]]]

    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]

    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]

    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]]

    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]]

    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]

    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]

    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
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  15. def toString(): String
    Definition Classes
    AnyRef → Any
  16. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped