simple_system

System Information for Eiffel

Foundation Layer v1.0.0 MIT

Overview

simple_system provides SCOOP-compatible system information access for Eiffel applications. It wraps Win32 system APIs through a clean C interface, enabling queries about the computer, processor, memory, and operating system without threading complications.

Part of the simple_* ecosystem of focused, single-purpose Eiffel libraries.

Quick Start

Installation

<library name="simple_system" location="$SIMPLE_EIFFEL/simple_system/simple_system.ecf"/>

Basic Usage

local
    sys: SIMPLE_SYSTEM
do
    create sys

    -- Computer info
    print ("Computer: " + sys.computer_name + "%N")
    print ("User: " + sys.user_name + "%N")

    -- Directories
    print ("Windows: " + sys.windows_directory + "%N")
    print ("Temp: " + sys.temp_directory + "%N")

    -- Processor info
    print ("CPUs: " + sys.processor_count.out + "%N")
    print ("Architecture: " + sys.processor_architecture + "%N")
    print ("64-bit: " + sys.is_64_bit.out + "%N")

    -- Memory info
    print ("Total RAM: " + sys.total_memory_gb.out + " GB%N")
    print ("Available: " + sys.available_memory_gb.out + " GB%N")

    -- OS info
    print ("OS Version: " + sys.os_version_string + "%N")
    print ("Windows 11: " + sys.is_windows_11.out + "%N")
end

Features

Computer Info

Computer name, user name

Directories

Windows, System32, Temp directories

Processor

Count, architecture, page size

Memory

Total and available in MB/GB

API Reference

Computer Information

FeatureDescription
computer_nameName of the computer
user_nameName of the current user

Directory Information

FeatureDescription
windows_directoryWindows installation directory (C:\Windows)
system_directorySystem directory (C:\Windows\System32)
temp_directoryTemporary files directory

Processor Information

FeatureDescription
processor_countNumber of logical processors
processor_architecture"x86", "x64", "ARM64", or "unknown"
is_64_bitIs the processor 64-bit?
page_sizeMemory page size in bytes

Memory Information

FeatureDescription
total_memory_mbTotal physical memory in megabytes
available_memory_mbAvailable physical memory in megabytes
total_memory_gbTotal physical memory in gigabytes
available_memory_gbAvailable physical memory in gigabytes

OS Information

FeatureDescription
os_major_versionOS major version number
os_minor_versionOS minor version number
os_build_numberOS build number
os_version_stringFull OS version (e.g., "10.0.22631")
is_windows_10_or_laterIs this Windows 10 or later?
is_windows_11Is this Windows 11? (Build 22000+)