Skip to content

Query Platform OS information

Finalspace edited this page May 29, 2026 · 2 revisions

Table of Contents

FPL provides a couple of functions for querying operating system or platform information.

Get Current Platform Type/Name

Use fplGetPlatformType() to get the current fplPlatformType .

This can be useful to do different operations on different platforms.

Use fplGetPlatformName() to get a string representation for the given fplPlatformType .

 currentPlatform = ();
const char *platformName = (currentPlatform);
("Platform: %s\n", platformName);

Query OS Version, Kernel, Distribution etc.

You can retrieve the version/name of your operating system by calling fplOSGetVersionInfos() .

See fplOSVersionInfos for more details.

 infos = ;
if ((&infos)) {
    ("Operating system name: %s\n", infos.);
    ("Operating system version: %s.%s.%s.%s\n", infos..major, infos..minor, infos..fix, infos..build);
}

Get current username

Use fplSessionGetUsername() to get the username for the current session.

char usernameBuffer[256];
if ((usernameBuffer, (usernameBuffer))) {
    ("Current username: %s\n", usernameBuffer);
}

Final Platform Layer

Pages

Topics

Data Structures

Clone this wiki locally