Module Opendal.Operator

val new_operator : string -> (string * string) list -> (Opendal_core.Operator.operator, string) Stdlib.result

new_operator scheme config_map Create a new block operator from given scheme and config_map.

  • parameter scheme

    Supported services, for details, refer to https://opendal.apache.org/docs/category/services/

  • parameter config_map

    Configuration information required by the target service

  • returns

    The block operator

val list : Opendal_core.Operator.operator -> string -> (Opendal_core.Operator.entry array, string) Stdlib.result
val stat : Opendal_core.Operator.operator -> string -> (Opendal_core.Operator.metadata, string) Stdlib.result

is_exist operator path Get current path's metadata **without cache** directly.

  • parameter operator

    The operator

  • parameter path

    want to stat

  • returns

    metadata

val is_exist : Opendal_core.Operator.operator -> string -> (bool, string) Stdlib.result

is_exist operator path Check if this path exists or not.

  • parameter operator

    The operator

  • parameter path

    want to check

  • returns

    is exists

val create_dir : Opendal_core.Operator.operator -> string -> (bool, string) Stdlib.result

create_dir operator path Create a dir at given path.

# Notes

To indicate that a path is a directory, it is compulsory to include a trailing / in the path. Failure to do so may result in `NotADirectory` error being returned by OpenDAL.

# Behavior

  • Create on existing dir will succeed.
  • Create dir is always recursive, works like `mkdir -p`
  • parameter operator

    The operator

  • parameter path

    want to create dir

val read : Opendal_core.Operator.operator -> string -> (char array, string) Stdlib.result

read operator path Read the whole path into a bytes.

  • parameter operator

    The operator

  • parameter path

    want to read

  • returns

    data of path

val reader : Opendal_core.Operator.operator -> string -> (Opendal_core.Operator.reader, string) Stdlib.result

read operator path Create a new reader which can read the whole path.

  • parameter operator

    The operator

  • parameter path

    want to read

  • returns

    reader

val write : Opendal_core.Operator.operator -> string -> bytes -> (unit, string) Stdlib.result

write operator path data Write bytes into given path.

  • Write will make sure all bytes has been written, or an error will be returned.
  • parameter operator

    The operator

  • parameter path

    want to write

  • parameter data

    want to write

val copy : Opendal_core.Operator.operator -> string -> string -> (unit, string) Stdlib.result

copy operator from to Copy a file from from to to.

  • from and to must be a file.
  • to will be overwritten if it exists.
  • If from and to are the same, nothing will happen.
  • copy is idempotent. For same from and to input, the result will be the same.
  • parameter operator

    The operator

  • parameter from

    file path

  • parameter to

    file path

val rename : Opendal_core.Operator.operator -> string -> string -> (unit, string) Stdlib.result

rename operator from to Rename a file from from to to.

  • from and to must be a file.
  • to will be overwritten if it exists.
  • If from and to are the same, a `IsSameFile` error will occur.
  • parameter operator

    The operator

  • parameter from

    file path

  • parameter to

    file path

val delete : Opendal_core.Operator.operator -> string -> (unit, string) Stdlib.result

delete operator path Delete given path.

  • Delete not existing error won't return errors.
  • parameter operator

    The block operator

  • parameter path

    file path

val remove : Opendal_core.Operator.operator -> string array -> (unit, string) Stdlib.result

remove operator paths Remove path array.

  • We don't support batch delete now, will call delete on each object in turn
  • parameter operator

    The block operator

  • parameter paths

    file path array

val remove_all : Opendal_core.Operator.operator -> string -> (unit, string) Stdlib.result

remove_all operator path Remove the path and all nested dirs and files recursively.

  • We don't support batch delete now, will call delete on each object in turn
  • parameter operator

    The block operator

  • parameter path

    file path

module Reader : sig ... end
module Metadata : sig ... end
module Entry : sig ... end