class type filesystem =Abstract access to filesystemsobject
..end
Netfs.stream_fs
method path_encoding : Netconversion.encoding option
Netfs.stream_fs
. Plasma does
not care about encodings.method path_exclusions : (int * int) list
Netfs.stream_fs
. Plasma does
not care about this.method nominal_dot_dot : bool
Netfs.stream_fs
. Plasma does
not care about this.method read : read_flag list -> string -> Netchannels.in_obj_channel
read flags filename
: Opens the file filename
for reading,
and returns the input stream. Flags:`Skip n
: Skips the first n
bytes of the file. On many
filesystems this is more efficient than reading n
bytes and
dropping them; however, there is no guarantee that this
optimization exists.`Binary
: Opens the file in binary mode (if there is such
a distinction)`Streaming
for network filesystems: If possible, open the
file in streaming mode, and avoid to copy the whole file to the local
disk before returning the Netchannels.in_obj_channel
.
Streaming mode is faster, but has also downsides. Especially,
the implementation of read
can do less to recover from
transient network problems (like retrying the whole download).
Support for this flag is optional, and it is ignored if
there is no extra streaming mode.method read_file : read_file_flag list -> string -> local_file
read_file flags filename
: Opens the file filename
for reading,
and returns the contents as a local_file
. Use the method
filename
to get the file name of the local file. The file
may be temporary, but this is not required. The method close
of the returned object should be called when the file is no
longer needed. In case of a temporary file, the file can then
be deleted. Flags:`Binary
: Opens the file in binary mode (if there is such
a distinction)method write : write_flag list -> string -> Netchannels.out_obj_channel
write flags filename
: Opens (and optionally creates) the filename
for writing, and returns the output stream. Flags:`Create
: If the file does not exist, create it`Truncate
: If the file exists, truncate it to zero before
writing`Exclusive
: The `Create
is done exclusively`Binary
: Opens the file in binary mode (if there is such
a distinction)`Streaming
: see read
(above) for explanations`Repl n
: the file is created with replication factor n
.
n=0
means to use the default.`Location s
: the location s
is the preferred physical
place for the file. This is only a suggestion. It is
filesystem-dependent how locations are named. The location
"_local"
is reserved, and means the location where the
write is done. This configuration remains (at least) in effect
while this filesystem object is used to write the file
(including further write
and copy_in_from_buf
calls).`Create
nor
`Truncate
is specified because overwriting an existing file
is not supported. There are also filesystems that cannot even
modify files by truncating them first, but only allow to write
to new files.
It is unspecified whether the file appears in the directory directly
after calling write
or first when the stream is closed.
method write_file : write_file_flag list -> string -> local_file -> unit
write_file flags filename localfile
: Opens the file filename
for writing, and copies the contents of the localfile
to it.
It is ensured that the method close
of localfile
is called
once the operation is finished (whether successful or not).
Flags:`Create
: If the (remote) file does not exist, create it`Truncate
: If the file exists, truncate it to zero before
writing`Exclusive
: The `Create
is done exclusively`Binary
: Opens the file in binary mode (if there is such
a distinction)`Link
: Allows that the destination file is created as a hard
link of the original file. This is tried whatever other mode
is specified. If not successful, a copy is done instead.`Repl n
: the file is created with replication factor n
.
n=0
means to use the default.`Location s
: the location s
is the preferred physical
place for the file. This is only a suggestion. It is
filesystem-dependent how locations are named. The location
"_local"
is reserved, and means the location where the
write is done.method size : size_flag list -> string -> int64
method test : test_flag list -> string -> test_type -> bool
`N
and `H
tests). By specifying the `Link
flag
symlinks are not followed.method test_list : test_flag list -> string -> test_type list -> bool list
test
but this function performs all tests in the list
at once, and returns a bool for each test.method remove : remove_flag list -> string -> unit
Flags:
`Recursive
: Remove the contents of the non-empty directory
recursively. This is an optional feature. There needs not to
be any protection against operations done by other processes
that affect the directory tree being deleted.method rename : rename_flag list -> string -> string -> unit
method symlink : symlink_flag list -> string -> string -> unit
symlink flags oldpath newpath
: Creates a symlink. This
is an exclusive create, i.e. the operation fails if newpath
already exists.method readdir : readdir_flag list -> string -> string list
method readlink : readlink_flag list -> string -> string
method mkdir : mkdir_flag list -> string -> unit
`Path
: Creates missing parent directories. This is an
optional feature. (If not supported, ENOENT is reported.)`Nonexcl
: Non-exclusive create.method rmdir : rmdir_flag list -> string -> unit
method copy : copy_flag list -> string -> string -> unit
Flags:
`Repl n
: the copied file is created with replication factor n
.
n=0
means to use the default.`Location s
: the location s
is the preferred physical
place for the new file. This is only a suggestion. It is
filesystem-dependent how locations are named. The location
"_local"
is reserved, and means the location where the
write is done.method cancel : unit -> unit
write
. The user must also call
the close_out
method after cancelling. The effect
is that after the close no more network activity will occur.method blocksize : string -> int
method copy_out_to_buf : string -> int64 -> Netsys_mem.memory -> int -> unit
copy_out_to_buf path pos mem len
: XXX
Supports partial evaluation in order to factor the file lookup out:
let f = fs # copy_out_to_buf path
Now, f pos mem len
can be called several times to access the
same file.
method copy_in_from_buf : string -> int64 -> Netsys_mem.memory -> int -> unit
copy_in_from_buf path pos mem len
: XXX
Also supports partial evaluation like copy_out_to_buf
.
method commit_files : (string * string) list -> unit
method location_info : string -> (Unix.inet_addr * string) list
method blocklist : string -> Plasma_rpcapi_aux.blockinfo list
method have_link : string -> bool
link
is supported for this pathmethod link : link_flag list -> string -> string -> unit
link flags old_name new_name
method set_aside : unit -> unit
method close : unit -> unit
method open_cluster : string -> Unixqueue.event_system -> Plasma_client.plasma_cluster option
The cluster object is configured so it can authenticate. This
is the only configuration, though.
method open_filesystem : unit -> filesystem