What's the the best way to get the current operating system?
I'm looking for something similar to python's sys.platform, which returns 'linux', 'windows', etc, or even better, something like python's platform module which gives you the operating system, distribution, release version, etc.
when defined windows: echo "I'm on Windows!" elif defined linux: echo "I'm on Linux!" else: echo "I'm on some other platform!" when defined x86: echo "x86 specific code!" elif defined amd64: echo "amd64 specific code!" else: echo "generic code!" when (NimMajor,NimMinor,NimPatch) > (0,10,2): echo "Such a modern Nim version!" echo "OS: ", hostOS, ", CPU: ", hostCPU, ", cpuEndian: ", cpuEndian, ", NimVersion: ", NimVersion This prints on my system: I'm on Linux! amd64 specific code! Such a modern Nim version! OS: linux, CPU: amd64, cpuEndian: littleEndian, NimVersion: 0.10.3
Unable to build nimsuggest
Nim: How to check if a float is nan or inf?
How to help nim prove that indices from an iterator are disjoint (within parallel section)?
printing an array in Nim using echo
Nim stored procedure reference in tuple
Remove constant after compilation in Nim
How do I use a `concept` in Nim?
how to create an IntSet on the heap in nim?
How to benchmark few lines of code in nim?
what is nim type definition for generic procedure?
Does a nim library contain an argsort implementation or wrapper?
nim jester how to change static route and directory
nim linker error while linking to libsodium
Can countup and countdown iterators in Nim language be used in variable declaration?
How do I write unit test for code that should fail to compile in Nim?
Difference between void proc and void proc with discard