gleam/erlang/os

Types

Represents operating system kernels

pub type OsFamily {
  WindowsNt
  Linux
  Darwin
  FreeBsd
  Other(String)
}

Constructors

  • WindowsNt
  • Linux
  • Darwin
  • FreeBsd
  • Other(String)

Functions

pub fn family() -> OsFamily

Returns the kernel of the host operating system.

Unknown kernels are reported as Other(String); e.g. Other("sunos").

Examples

family()
// -> Linux
family()
// -> Darwin
family()
// -> Other("sunos")
Search Document