package uwt
synchronous system calls
These synchronous might be useful, if you also target windows users:
- filenames must be utf8 encoded (see comment to ECHARSET)
- sometimes additional options are available, e.g.
Fs.openfile
include Uwt_base.Fs_functions with type 'a t := 'a Uwt_base.uv_result
include module type of Uwt_base.Fs_types
with type uv_open_flag = Uwt_base.Fs_types.uv_open_flag
with type file_kind = Uwt_base.Fs_types.file_kind
with type symlink_mode = Uwt_base.Fs_types.symlink_mode
with type access_permission = Uwt_base.Fs_types.access_permission
with type stats = Uwt_base.Fs_types.stats
type uv_open_flag = Uwt_base.Fs_types.uv_open_flag =
| O_RDONLY
| O_WRONLY
| O_RDWR
| O_NONBLOCK
(*Unix only, ignored otherwise
*)| O_CREAT
| O_EXCL
| O_TRUNC
| O_APPEND
| O_NOCTTY
(*Unix only, ignored otherwise
*)| O_DSYNC
(*only supported on some Unix platforms, ignored otherwise
*)| O_SYNC
(*only supported on some Unix platforms, ignored otherwise
*)| O_RSYNC
(*only supported on some Unix platforms, ignored otherwise
*)| O_TEMPORARY
(*windows only, ignored on Unix
*)| O_SHORT_LIVED
(*windows only, ignored on Unix
*)| O_SEQUENTIAL
(*windows only, ignored on Unix
*)| O_RANDOM
(*windows only, ignored on Unix
*)
O_CLOEXEC
and O_SHARE_DELETE
, O_SHARE_WRITE
, O_SHARE_READ
don't exist, because these flags are unconditionally added by libuv, if the platform supports them.
type file_kind = Uwt_base.Fs_types.file_kind =
type stats = Uwt_base.Fs_types.stats = {
st_dev : int;
st_kind : file_kind;
st_perm : int;
st_nlink : int;
st_uid : int;
st_gid : int;
st_rdev : int;
st_ino : int;
st_size : int64;
st_blksize : int;
st_blocks : int;
st_flags : int;
st_gen : int;
st_atime : int64;
st_atime_nsec : int;
st_mtime : int64;
st_mtime_nsec : int;
st_ctime : int64;
st_ctime_nsec : int;
st_birthtime : int64;
st_birthtime_nsec : int;
}
val openfile :
?perm:int ->
mode:uv_open_flag list ->
string ->
Uwt_base.file Uwt_base.uv_result
val read :
?pos:int ->
?len:int ->
Uwt_base.file ->
buf:bytes ->
int Uwt_base.uv_result
val read_ba :
?pos:int ->
?len:int ->
Uwt_base.file ->
buf:Uwt_base.buf ->
int Uwt_base.uv_result
_ba function are unsafe. Bigarrays are passed directly to libuv (no copy to c heap or stack).
val write :
?pos:int ->
?len:int ->
Uwt_base.file ->
buf:bytes ->
int Uwt_base.uv_result
val write_string :
?pos:int ->
?len:int ->
Uwt_base.file ->
buf:string ->
int Uwt_base.uv_result
val write_ba :
?pos:int ->
?len:int ->
Uwt_base.file ->
buf:Uwt_base.buf ->
int Uwt_base.uv_result
val writev :
Uwt_base.file ->
Uwt_base.Iovec_write.t list ->
int Uwt_base.uv_result
If the number of buffers is greater than IOV_MAX, newer libuv versions already contains code to circumvent this problem
val close : Uwt_base.file -> unit Uwt_base.uv_result
val unlink : string -> unit Uwt_base.uv_result
val mkdir : ?perm:int -> string -> unit Uwt_base.uv_result
val rmdir : string -> unit Uwt_base.uv_result
val fsync : Uwt_base.file -> unit Uwt_base.uv_result
val fdatasync : Uwt_base.file -> unit Uwt_base.uv_result
val ftruncate : Uwt_base.file -> len:int64 -> unit Uwt_base.uv_result
val stat : string -> stats Uwt_base.uv_result
val lstat : string -> stats Uwt_base.uv_result
val fstat : Uwt_base.file -> stats Uwt_base.uv_result
val rename : src:string -> dst:string -> unit Uwt_base.uv_result
val link : target:string -> link_name:string -> unit Uwt_base.uv_result
val symlink :
?mode:symlink_mode ->
src:string ->
dst:string ->
unit ->
unit Uwt_base.uv_result
val mkdtemp : string -> string Uwt_base.uv_result
val sendfile :
?pos:int64 ->
?len:nativeint ->
dst:Uwt_base.file ->
src:Uwt_base.file ->
unit ->
nativeint Uwt_base.uv_result
val utime : string -> access:float -> modif:float -> unit Uwt_base.uv_result
val futime :
Uwt_base.file ->
access:float ->
modif:float ->
unit Uwt_base.uv_result
val readlink : string -> string Uwt_base.uv_result
val access : string -> access_permission list -> unit Uwt_base.uv_result
val chmod : string -> perm:int -> unit Uwt_base.uv_result
val fchmod : Uwt_base.file -> perm:int -> unit Uwt_base.uv_result
val chown : string -> uid:int -> gid:int -> unit Uwt_base.uv_result
val fchown : Uwt_base.file -> uid:int -> gid:int -> unit Uwt_base.uv_result
val scandir : string -> (file_kind * string) array Uwt_base.uv_result
val realpath : string -> string Uwt_base.uv_result