package async_unix

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Async_unix.SysSource

This module overrides everything in the Core.Sys module that might block. Functions do the same thing as their counterparts in Core.Sys, but instead return deferreds. For a description of their semantics see the documentation for the Core.Sys module.

Sourceval argv : string array
  • deprecated [since 2019-08] Use [Sys.get_argv] instead, which has the correct behavior when [caml_sys_modify_argv] is called.
Sourceval get_argv : unit -> string array
Sourceval executable_name : string
Sourceval file_exists : ?follow_symlinks:bool -> string -> [ `Yes | `No | `Unknown ] Async_kernel.Deferred.t
Sourceval file_exists_exn : ?follow_symlinks:bool -> string -> bool Async_kernel.Deferred.t
Sourceval when_file_exists : ?follow_symlinks:bool -> ?poll_delay:Core.Time.Span.t -> string -> unit Async_kernel.Deferred.t

when_file_exists ?poll_delay file returns a deferred that becomes determined when file exists. The default poll delay is 0.5 seconds. It raises an exception if it can not check whether the file is there, in the same cases file_exists returns `Unknown.

Sourceval when_file_changes : ?on_exn:(exn -> unit) -> ?poll_delay:Core.Time.Span.t -> string -> Core.Time.t Async_kernel.Pipe.Reader.t

when_file_changes file polls file using stat and writes file's mtime to the pipe every time it changes. The first time in the pipe will be file's current mtime. To stop polling, close the pipe.

Sourceval is_directory : ?follow_symlinks:bool -> string -> [ `Yes | `No | `Unknown ] Async_kernel.Deferred.t
Sourceval is_directory_exn : ?follow_symlinks:bool -> string -> bool Async_kernel.Deferred.t
Sourceval is_file : ?follow_symlinks:bool -> string -> [ `Yes | `No | `Unknown ] Async_kernel.Deferred.t
Sourceval is_file_exn : ?follow_symlinks:bool -> string -> bool Async_kernel.Deferred.t
Sourceval remove : string -> unit Async_kernel.Deferred.t
Sourceval rename : string -> string -> unit Async_kernel.Deferred.t
Sourceval getenv : string -> string option
Sourceval getenv_exn : string -> string
Sourceval command : string -> int Async_kernel.Deferred.t
Sourceval command_exn : string -> unit Async_kernel.Deferred.t
Sourceval quote : string -> string
Sourceval chdir : string -> unit Async_kernel.Deferred.t
Sourceval getcwd : unit -> string Async_kernel.Deferred.t
Sourceval readdir : string -> string array Async_kernel.Deferred.t
Sourceval ls_dir : string -> string list Async_kernel.Deferred.t
Sourceval home_directory : unit -> string Async_kernel.Deferred.t
Sourceval opaque_identity : 'a -> 'a
Sourceval interactive : bool Core.ref
Sourceval os_type : string
Sourceval word_size : int
Sourceval int_size : int
Sourceval big_endian : bool
Sourceval ocaml_version : string
Sourceval execution_mode : unit -> [ `Bytecode | `Native ]
Sourceval c_int_size : unit -> int
OCaml

Innovation. Community. Security.