Os.NameOS names.
The type for OS identifiers. Unless you create them yourself these strings are normalized: non-empty and lowercase ASCII.
The type for OS names.
Names are sorted into families. The datum of each family has the concrete OS identifier.
Warning. Minor versions of the library may add new family enumerants or attach a family to an identifier previously classified as Other (moving between families should not happen, except to fix the odd bug). As such:
Other "…" constants is not recommended. If you need to select such an identifier spattern match on id._ rather than Other _.val get : ?id_like:bool -> unit -> tget () is the name of the operating system running the process. If id_like is true returns a possible parent name instead (e.g. "debian" instead of "ubuntu"), defaults to false. This is determined, along with Os.Version.get as follows:
On POSIX environments it depends on the lowercased sysname field returned by uname(2):
"linux", the file /etc/os-release is consulted. The lowercased ID or first element of ID_LIKE if id_like is true determines id and Name.Linux id is returned. The field VERSION_ID is used to determine version. If the file can't be found id is sysname and version "unknown"."freebsd", behaves like the Linux case but Bsd id is returned."darwin", the file /System/Library/CoreServices/SystemVersion.plist is consulted. The lowercased ProductName key determines id and Name.Darwin id is returned. The ProductVersion key determines version. If the file can't be found id is sysname and version "unknown"."netbsd" and "openbsd" then Name.Bsd sysname is returned and version is "unknown"."cygwin_nt", then Name.Windows "cygwin" and version is determined like windows (see below).Other sysname and version is "unknown"Windows "windows" and version uses the the caml_win32_* variables of the OCaml runtime system to format a version numberName.Other "unknown" and version is "unknown"of_string s dermines an OS from s normalized by ASCII lowercasing. Unrecognized OS identifiers end up as Other with the normalized s. Strings printed by pp are guaranteed to parse (with the family as the identifier).
Identifiers returned by Os.Name.get and classified into a proper family may be classified as Other _ by this function, as the contextual information provided by uname(2) is not available. However if family is provided, s is simply normalized and the family of family is used in the result.
val bsd : tbsd is Bsd "bsd".
val darwin : tdarwin is Darwin "darwin".
val linux : tlinux is Linux "linux".
val windows : twindows is Windows "windows".
val unknown : tunknown is Other "unknown".
Warning. The standard comparisons functions assert families. If you want the finer grain you can use String equalities on id.
equal asserts equality by family. Other id values are each their own distinct family.
pp formats families for inspection. The concrete identifier is not printed use pp_id for that.