mist/internal/file

Types

pub type File {
  File(descriptor: FileDescriptor, file_size: Int)
}

Constructors

pub type FileDescriptor
pub type FileError {
  IsDir
  NoAccess
  NoEntry
  UnknownFileError
}

Constructors

  • IsDir
  • NoAccess
  • NoEntry
  • UnknownFileError
pub type SendError {
  FileErr(FileError)
  SocketErr(socket.SocketReason)
}

Constructors

Values

pub fn close(file: FileDescriptor) -> Result(Nil, FileError)
pub fn error_to_string(error: FileError) -> String
pub fn open(file: BitArray) -> Result(FileDescriptor, FileError)
pub fn pread(
  fd: FileDescriptor,
  location: Int,
  bytes: Int,
) -> Result(BitArray, FileError)
pub fn sendfile(
  transport: transport.Transport,
  file_descriptor file_descriptor: FileDescriptor,
  socket socket: socket.Socket,
  offset offset: Int,
  bytes bytes: Int,
  options options: List(a),
) -> Result(Nil, SendError)
pub fn stat(filename: BitArray) -> Result(File, FileError)
✨ Search Document