package core_unix
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=4f70a9d3a761799d00c0a207942b4abd9f1a144bbcb19df98021d9fb7bfa9e5f
doc/core_unix.filename_unix/Filename_unix/index.html
Module Filename_unix
Source
Warning! this library assumes we are in a POSIX compliant OS.
realpath path
val open_temp_file :
?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.
val open_temp_file_fd :
?close_on_exec:bool ->
?perm:int ->
?in_dir:string ->
string ->
string ->
string * Filename_unix__.Import.Unix.file_descr
Similar to Core_filename.open_temp_file
, but returns a Unix file descriptor open in read&write mode instead of an Out_channel.t
.
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.
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.
val 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
.
arg_type
is create_arg_type Fn.id