package core_unix

  1. Overview
  2. Docs
Unix-specific portions of Core

Install

Dune Dependency

Authors

Maintainers

Sources

v0.17.1.tar.gz
md5=9370dca36f518fcea046d2752e3de22b
sha512=c4e8ce9d5885ac8fa8d554a97e1857f3a1c933e0eb5dfd4fe874412b9d09e6d0a2973b644733855553f33f5c859719228f0e6aaf3a2b7eb5befb46fc513750de

doc/core_unix.filename_unix/Filename_unix/index.html

Module Filename_unixSource

Warning! this library assumes we are in a POSIX compliant OS.

Sourceval realpath : string -> string

realpath path

  • returns

    the canonicalized absolute pathname of path.

  • raises Unix_error

    on errors.

Sourceval open_temp_file : ?close_on_exec:bool -> ?perm:int -> ?in_dir:string -> string -> string -> string * Core.Out_channel.t

Same as temp_file, but returns both the name of a fresh temporary file, and an output channel opened (atomically) on this file. This function is more secure than temp_file: there is no risk that the temporary file will be modified (e.g. replaced by a symbolic link) before the program opens it.

Sourceval open_temp_file_fd : ?close_on_exec:bool -> ?perm:int -> ?in_dir:string -> string -> string -> string * Filename_unix__.Import.Unix.file_descr

Similar to open_temp_file, but returns a Unix file descriptor open in read&write mode instead of an Out_channel.t.

Sourceval temp_file : ?perm:int -> ?in_dir:string -> string -> string -> string

temp_file ?perm ?in_dir_name prefix suffix

Returns the name of a fresh temporary file in the temporary directory. The base name of the temporary file is formed by concatenating prefix, then .tmp., then a 6-digit hex number, then suffix. The temporary file is created empty. The file is guaranteed to be fresh, i.e. not already existing in the directory.

  • parameter in_dir

    the directory in which to create the temporary file. The default is temp_dir_name

  • parameter perm

    the permission of the temporary file. The default value is 0o600 (readable and writable only by the file owner)

Note that prefix and suffix will be changed when necessary to make the final filename valid POSIX.

temp_dir is the same as temp_file but creates a temporary directory.

Sourceval temp_dir : ?perm:int -> ?in_dir:string -> string -> string -> string
Sourceval create_arg_type : ?key:'a Core.Univ_map.Multi.Key.t -> (string -> 'a) -> 'a Core.Command.Arg_type.t

create_arg_type's resulting Arg_type.t does bash autocompletion, via compgen.

Sourceval arg_type : string Core.Command.Arg_type.t

arg_type is create_arg_type Fn.id

OCaml

Innovation. Community. Security.