platform
platform returns the target operating system as a native OsPlatform enum. It reflects the target this binary was compiled for, not a runtime guess.
Signature
platform(): OsPlatformtyrus
import { platform } from "tyrus:os";
import { OsPlatform } from "tyrus:os";
const currentPlatform: OsPlatform = platform();
if (currentPlatform === OsPlatform.Windows) {
print("running on Windows");
}OsPlatform Members
| Member | Meaning |
|---|---|
Linux | Linux |
MacOS | macOS |
Windows | Windows |
Other | Any other target |
