Like read_dir (with recurse=true), this function walks a directory recursively and yields either files or directories. Is a file anything that doesn't satisfy is_directory (including symlinks, etc.)
raises Sys_error
in case of error (e.g. permission denied) during iteration.
val with_temp : ?temp_dir:string->prefix:string->suffix:string->(string ->'a)->'a
with_temp ~prefix ~suffix f will call f with the name of a new temporary file (located in temp_dir). After f returns, the file is deleted. Best to be used in combination with with_out. See Filename.temp_file.
since
0.17
\ No newline at end of file
+File (containers.CCIO.File)
Module CCIO.File
type t = string
A file should be represented by its absolute path, but currently this is not enforced.
Like read_dir (with recurse=true), this function walks a directory recursively and yields either files or directories. Is a file anything that doesn't satisfy is_directory (including symlinks, etc.)
raises Sys_error
in case of error (e.g. permission denied) during iteration.
val with_temp : ?temp_dir:string->prefix:string->suffix:string->(string ->'a)->'a
with_temp ~prefix ~suffix f will call f with the name of a new temporary file (located in temp_dir). After f returns, the file is deleted. Best to be used in combination with with_out. See Filename.temp_file.
since
0.17
\ No newline at end of file
diff --git a/dev/containers/CCIO/index.html b/dev/containers/CCIO/index.html
index 88445576..b1de39fd 100644
--- a/dev/containers/CCIO/index.html
+++ b/dev/containers/CCIO/index.html
@@ -17,6 +17,6 @@
(fun oc ->
write_gen oc chunks
)
- ) ;;
since
0.6
before 0.12
was in 'containers.io', now moved into 'containers'
val with_in : ?mode:int->?flags:Stdlib.open_flag list-> string ->(Stdlib.in_channel ->'a)->'a
Open an input file with the given optional flag list, calls the function on the input channel. When the function raises or returns, the channel is closed.
raises Sys_error
in case of error (same as open_in and close_in).
parameter flags
opening flags (default [Open_text]). Open_rdonly is used in any cases.
val read_chunks_gen : ?size:int-> Stdlib.in_channel ->string gen
Read the channel's content into chunks of size size. NOTE the generator must be used within the lifetime of the channel, see warning at the top of the file.
val read_chunks_seq : ?size:int-> Stdlib.in_channel ->string Stdlib.Seq.t
Read the channel's content into chunks of size size. NOTE the generator must be used within the lifetime of the channel, see warning at the top of the file.
since
3.5
val read_line : Stdlib.in_channel ->string option
Read a line from the channel. Returns None if the input is terminated. The "\n" is removed from the line.
val read_lines_gen : Stdlib.in_channel ->string gen
Read all lines. The generator should be traversed only once. NOTE the generator must be used within the lifetime of the channel, see warning at the top of the file.
val read_lines_seq : Stdlib.in_channel ->string Stdlib.Seq.t
Read all lines. NOTE the seq must be used within the lifetime of the channel, see warning at the top of the file.
since
3.5
val read_lines_l : Stdlib.in_channel ->string list
Read all lines into a list.
val read_all : ?size:int-> Stdlib.in_channel -> string
Read the whole channel into a buffer, then converted into a string.
parameter size
the internal buffer size.
since
0.7
val read_all_bytes : ?size:int-> Stdlib.in_channel -> Stdlib.Bytes.t
Read the whole channel into a mutable byte array.
parameter size
the internal buffer size.
since
0.12
Output
val with_out : ?mode:int->?flags:Stdlib.open_flag list-> string ->(Stdlib.out_channel ->'a)->'a
tee funs gen behaves like gen, but each element is given to every function f in funs at the time the element is produced. The returned generator will raise any exception that f raises
val with_in : ?mode:int->?flags:Stdlib.open_flag list-> string ->(Stdlib.in_channel ->'a)->'a
Open an input file with the given optional flag list, calls the function on the input channel. When the function raises or returns, the channel is closed.
raises Sys_error
in case of error (same as open_in and close_in).
parameter flags
opening flags (default [Open_text]). Open_rdonly is used in any cases.
val read_chunks_gen : ?size:int-> Stdlib.in_channel ->string gen
Read the channel's content into chunks of size size. NOTE the generator must be used within the lifetime of the channel, see warning at the top of the file.
val read_chunks_seq : ?size:int-> Stdlib.in_channel ->string Stdlib.Seq.t
Read the channel's content into chunks of size size. NOTE the generator must be used within the lifetime of the channel, see warning at the top of the file.
since
3.5
val read_line : Stdlib.in_channel ->string option
Read a line from the channel. Returns None if the input is terminated. The "\n" is removed from the line.
val read_lines_gen : Stdlib.in_channel ->string gen
Read all lines. The generator should be traversed only once. NOTE the generator must be used within the lifetime of the channel, see warning at the top of the file.
val read_lines_seq : Stdlib.in_channel ->string Stdlib.Seq.t
Read all lines. NOTE the seq must be used within the lifetime of the channel, see warning at the top of the file.
since
3.5
val read_lines_l : Stdlib.in_channel ->string list
Read all lines into a list.
val read_all : ?size:int-> Stdlib.in_channel -> string
Read the whole channel into a buffer, then converted into a string.
parameter size
the internal buffer size.
since
0.7
val read_all_bytes : ?size:int-> Stdlib.in_channel -> Stdlib.Bytes.t
Read the whole channel into a mutable byte array.
parameter size
the internal buffer size.
since
0.12
Output
val with_out : ?mode:int->?flags:Stdlib.open_flag list-> string ->(Stdlib.out_channel ->'a)->'a
tee funs gen behaves like gen, but each element is given to every function f in funs at the time the element is produced. The returned generator will raise any exception that f raises