os_type 0.2.1

Detect the operating system type
Documentation

Build Status

os_type

Rust library to detect the operating system type

Usage

Include this into your Cargo.toml:

[dependencies]
os_type="0.1.0"

In your code:

extern crate os_type;

fn foo() {
      match os_type::current_platform() {
        os_type::OSType::OSX => /*Do something here*/,
        _ => None
    }
}

Right now, the following operating systems are detected:

  • Mac OS X
  • CentOS
  • RedHat
  • Ubuntu

If you need support for more OS types, I am looking forward to your Pull Request.

License

MIT