fs2.io.file

package fs2.io.file

Type members

Classlikes

class AccessDeniedException(message: String, cause: Throwable) extends FileSystemException
Companion
object
sealed trait BasicFileAttributes

Attributes of a file that are provided by most operating systems and file systems.

Attributes of a file that are provided by most operating systems and file systems.

To get an instance of BasicFileAttributes, use Files[F].getBasicFileAttributes(path).

The fileKey operation returns a unique identifier for the file, if the operating system and file system supports providing such an identifier.

Companion
object
Companion
class
final class CopyFlag extends AnyVal
Companion
object
object CopyFlag extends CopyFlagCompanionApi
Companion
class
case class CopyFlags(value: List[CopyFlag])
Companion
object
object CopyFlags extends CopyFlagsCompanionPlatform
Companion
class
class DirectoryNotEmptyException(message: String, cause: Throwable) extends FileSystemException
Companion
object
class FileAlreadyExistsException(message: String, cause: Throwable) extends FileSystemException
Companion
object
trait FileHandle[F[_]] extends FileHandlePlatform[F]

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

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

Companion
object
object FileHandle extends FileHandleCompanionPlatform
Companion
class
trait FileKey

An opaque, unique identifier for a file.

An opaque, unique identifier for a file.

Paths which have the same FileKey (via univerals equals), as reported by Files[F].getBasicFileAttributes(path).fileKey, are guaranteed to reference the same file on the file system.

Note: not all operating systems and file systems support file keys, hence BasicFileAttributes#fileKey returns an Option[FileKey].

Companion
object
object FileKey
Companion
class
class FileSystemException(message: String, cause: Throwable) extends IOException
Companion
object
Companion
class
class FileSystemLoopException(file: String) extends FileSystemException
sealed trait Files[F[_]] extends FilesPlatform[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.

The operations on this trait are implemented for both the JVM and Node.js. Some operations only work on POSIX file systems, though such methods generally have "Posix" in their names (e.g. getPosixPermissions). A small number of methods are only available on the JVM (e.g. variant of list which takes a glob pattern) and are indicated as such in their ScalaDoc.

Companion
object
object Files extends FilesCompanionPlatform
Companion
class
final class Flag extends AnyVal
Companion
object
object Flag extends FlagCompanionApi
Companion
class
case class Flags(value: List[Flag])

Flags describing how a file should be opened by Files[F].open(path, flags).

Flags describing how a file should be opened by Files[F].open(path, flags).

Common flag combinations are available in the companion (e.g. Flags.Write) Custom combinations are supported via the apply method (e.g., Flags(Flag.Write, Flag.CreateNew)).

Companion
object
object Flags extends FlagsCompanionPlatform
Companion
class
class NoSuchFileException(message: String, cause: Throwable) extends FileSystemException
Companion
object
Companion
class
class NotDirectoryException(message: String, cause: Throwable) extends FileSystemException
Companion
object
final case class Path extends PathApi
Companion
object
object Path extends PathCompanionApi
Companion
class
sealed trait Permissions extends PermissionsPlatform

Describes the permissions of a file / directory.

Describes the permissions of a file / directory.

Note: currently, there is only one subtype -- PosixPermissions. More types may be added in the future (e.g. Windows ACLs).

Companion
object
Companion
class
sealed trait PosixPermission
Companion
object
Companion
class
final class PosixPermissions extends Permissions

Describes POSIX file permissions, where the user, group, and others are each assigned read, write, and/or execute permissions.

Describes POSIX file permissions, where the user, group, and others are each assigned read, write, and/or execute permissions.

The toString method provides a 9 character string where the first three characters indicate user permissions, the next three group permissions, and the final three others permissions. For example, rwxr-xr-- indicates the owner has read, write and execute, the group as read and execute, and others have read.

The value field encodes the permissions in the lowest 9 bits of an integer. bits 8-6 indicate read, write, and execute for the owner, 5-3 for the group, and 2-0 for others. rwxr-xr-- has the integer value 111101100 = 492.

The toOctalString method returns the a 3 digit string, where the first character indicates read, write and execute for the owner, the second digit for the group, and the third digit for others. rwxr-xr-- has the octal string 754.

Constructors from strings, octal strings, and integers, as well as explicitly enumerating permissions, are provided in the companion.

Companion
object
Companion
class
final case class ReadCursor[F[_]](file: FileHandle[F], offset: Long)

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.

Companion
object
object ReadCursor extends ReadCursorCompanionPlatform
Companion
class
final case class WriteCursor[F[_]](file: FileHandle[F], offset: Long)

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.

Companion
object
object WriteCursor extends WriteCursorCompanionPlatform
Companion
class