mcpp index

mcpplibs.os

import

mcpplibs.os: a C++ operating-system library over openkal --- processes, files, environment, terminals, directories and local IPC, with compile-time platform constants and a few platform modules

import mcpplibs.os;

Module name read from the upstream `export module` declaration in src/os.cppm.

mcpp add mcpplibs.os@0.4.8

Usage

From this repository's own test project — built and run by CI, not written for the website.

// mcpplibs.os on this runner: the platform, a published file, a list of directories, and a
// program started and read (this test, started again).
import std;
import mcpplibs.os;

namespace os = mcpplibs::os;

int main(int argc, char** argv) {
    if (argc > 1 && std::string_view(argv[1]) == "--echo") {
        (void)os::stdio::write_output("echoed");
        return 0;
    }
    if (argc > 1 && std::string_view(argv[1]) == "--both") {
        (void)os::stdio::write_output("out ");
        (void)os::stdio::write_error("err");
        return 0;
    }
    int failures = 0;
    auto check = [&](bool ok, std::string_view what) { if (!ok) { ++failures; std::println(std::cerr, "FAIL: {}", what); } };

    check(os::host() == os::PLATFORM, "built for a system, the host is that system");
    const auto dir = os::dirs::temp() / std::format("os-tests-{}", os::process::self()->id);
// …

tests/examples/os/tests/os.cpp · project tests/examples/os

Build · upstream manifest

modules
mcpplibs.os
targets
os (lib)
manifest version
0.4.8
dependencies
openkal
source
https://raw.githubusercontent.com/mcpplibs/os/0.4.8/mcpp.toml

Versions

VersionPlatforms Mirrorssha256
0.4.8 latest LinuxWindowsmacOS GLOBAL CN 267fe1ac72e4…
0.4.7 LinuxWindowsmacOS GLOBAL CN 3facaf405dd8…
0.4.6 LinuxWindowsmacOS GLOBAL CN e14dd08cd5d7…
0.4.5 LinuxWindowsmacOS GLOBAL CN 6f8345fd0a96…
0.4.4 LinuxWindowsmacOS GLOBAL CN 4f9e617ad53b…
Show all 24 versions
0.4.3 LinuxWindowsmacOS GLOBALCN 1e372cbb6cca…
0.4.2 LinuxWindowsmacOS GLOBALCN ca58bf5ffe59…
0.4.1 LinuxWindowsmacOS GLOBALCN 149ecc26e79a…
0.4.0 LinuxWindowsmacOS GLOBALCN ad0b61b96246…
0.3.1 LinuxWindowsmacOS GLOBALCN 26492cf9fe4a…
0.3.0 LinuxWindowsmacOS GLOBALCN 338a26822378…
0.2.9 LinuxWindowsmacOS GLOBALCN 4168f6a1a160…
0.2.8 LinuxWindowsmacOS GLOBALCN f64f2625cd11…
0.2.7 LinuxWindowsmacOS GLOBALCN c3f8ebcb921c…
0.2.6 LinuxWindowsmacOS GLOBALCN 7bea6784440d…
0.2.5 LinuxWindowsmacOS GLOBALCN 14a8e23093ee…
0.2.4 LinuxWindowsmacOS GLOBALCN 70089d2745ff…
0.2.3 LinuxWindowsmacOS GLOBALCN e280c00d8be6…
0.2.2 LinuxWindowsmacOS GLOBALCN 33c5d946c29d…
0.2.1 LinuxWindowsmacOS GLOBALCN 264a3b80ef40…
0.2.0 LinuxWindowsmacOS source 9dc147ad8dca…
0.1.2 LinuxWindowsmacOS source bf6f5cfb1518…
0.1.1 LinuxWindowsmacOS source c5abfb625ded…
0.1.0 LinuxWindowsmacOS GLOBALCN f7e4117612d7…