This repository has been archived on 2022-12-23. You can view files and clone it, but cannot push or open issues or pull requests.
fuck-premake-old2/website/docs/os.getversion.md
KyrietS 393fc4bc04 Docs maintenance
- filled missing heading in tables (intentionally not everywhere)
- fixed link to symbols.md
- removed an accidentally added *.md extension from libX11.so
2021-09-15 22:36:11 +02:00

1.0 KiB

Retrieve version information for the host operating system.

sysinfo = os.getversion()

Parameters

None.

Return Value

A table, containing the following key-value pairs:

Field Description
majorversion The major version number
minorversion The minor version number
revision The bug fix release or service pack number
description A human-readable description of the OS version

On platforms where this function has not been implemented, it will return zero for all version numbers, and the platform name as the description.

Availability

Premake 4.4 or later.

Examples

local ver = os.getversion()
print(string.format(" %d.%d.%d (%s)",
   ver.majorversion, ver.minorversion, ver.revision,
   ver.description))

-- On Windows XP: "5.1.3 (Windows XP)"
-- On OS X,: "10.6.6 (Mac OS X Snow Leopard)"