StormByte-System is the C++26 process, device and host module of the StormByte suite.
Spawn children with piped stdin/stdout/stderr, classify the medium behind a path, resolve directories and the current executable, inspect the machine, name the calling thread, and expand environment strings. POSIX and Windows stay behind one API. Failures are StormByte::Error::Fault in a per-type domain (StormByte.System.*). Nothing in this module throws.
Shared vs static follows CMake BUILD_SHARED_LIBS (declared in lib/, default ON). A plain configure builds the shared library. -DBUILD_SHARED_LIBS=OFF builds a static archive; on Windows the headers then do not use dllimport. Vendored StormByte-String (and Base through String) follows the same mode.
A shared build keeps this library as its own .so / .dll. Under the LGPL that is usually the simpler way to ship: the user can replace that file. A static archive is folded into your binary. The LGPL still applies to this code; you must give the recipient a way to relink your product with a different build of this library. If that does not fit how you distribute the final product, a commercial license is available from the copyright holder (see License).
| Goal | How it is achieved |
|---|---|
| One process API | Process starts on construct; pipes are private. Errors are Fault(), not exceptions. |
| Shell-like chaining | p1 >> p2 forwards stdout to stdin on a worker thread. |
| stdin control | << writes; << System::EoF closes the write end. |
| Medium behind a path | Device probes Kind, Access, Throughput and Window on demand. |
| This process on disk | Directory and File resolve cwd, home, temp and the running image. |
| This machine | Host reports name, OS, kernel, CPU, ISA, RAM and bitness. |
| This thread | ThisThread::Sleep and Name (reject, do not truncate, if too long). |
| Environment text | Variable::Expand (VAR% on Windows, ~ on UNIX). |
Process (fork/exec or CreateProcessW)Wait / timed Wait; Suspend / ResumeDevice classification (HDD, SSD, NVMe generations, USB, Network)Directory / File locations of this processHost identity and capacityThisThread sleep and nameVariable::ExpandPipe (pipe2 / CreatePipe)| Dependency | Role |
|---|---|
| StormByte-String 1.0.0 | UTF-8 / UTF-16 text across the DLL boundary (vendors Base 2.0.0) |
| Module | Role | API |
|---|---|---|
| Base | Error/Fault, visibility, Size, Bitmask, serialization, UUID, concepts | /StormByte |
| Buffer | FIFO, SharedFIFO, Ring, Producer/Consumer and multi-stage pipelines | /StormByte-Buffer |
| Config | Human-readable text and versioned binary documents | /StormByte-Config |
| Crypto | Hash, compress, encrypt, sign and key agreement | /StormByte-Crypto |
| Database | One API over SQLite, PostgreSQL and MariaDB | /StormByte-Database |
| Logger | Stream logger with levels, headers and redaction | /StormByte-Logger |
| Multimedia | Decode, encode and containers without raw FFmpeg types | /StormByte-Multimedia |
| Network | Framed packets, Client/Server, IPv4/IPv6 TCP | /StormByte-Network |
| String | Owned UTF-8 / UTF-16 text safe across a DLL boundary | /StormByte-String |
| System | This repository | /StormByte-System |
| Name | Role |
|---|---|
Process | Spawn and talk to a child. operator bool is true only while the child is live. Fault() is StormByte.System.Process. |
Device | Medium behind a path. operator bool is probe success, not permission. Fault() is StormByte.System.Device. Throughput / Window are virtual. |
Directory | Current, Home, Temporary, CurrentExecutable. bool + out String. LastError() is TLS in this module. |
File | Temporary(prefix, suffix) (caller unlinks) and CurrentExecutable. Same bool + LastError contract. |
Host | Name, Architecture, CPU, OS, Kernel, PageSize, PhysicalMemory, AvailableMemory, LogicalProcessors, Bitness. |
ThisThread | Sleep; Name get/set. Set returns false and TooLong if the platform limit is exceeded. |
Variable | Expand environment strings to StormByte::String::String. |
System::EoF | Close process stdin. |
Pipe is private. There is no StormByte/system/exception.hxx and no generic StormByte.System error domain.
On Windows use a real binary (cmd.exe, where.exe) instead of echo if it is not on PATH the way you expect.
On Windows pass C:\\. operator bool is not “can write”. A special device node is never writable. Symlinks are followed; a dangling link is BrokenSymlink.
Windows File::Temporary only uses the first three characters of the prefix (GetTempFileNameW). The suffix is appended after the generated name.
LogicalProcessors and Bitness do not update LastError. The others do. A failed Size is zero; a failed String is empty.
On Linux/macOS the pthread name limit is 15 characters. Windows SetThreadDescription does not use that limit.
A failed Windows expand returns the original text (same idea as a missing UNIX $HOME).
Process construction starts the child immediately and does not throw. operator bool is live status only.Wait sets TimedOut and leaves the child running.SIGPIPE once process-wide so a closed pipe peer reports write failure instead of killing the host.Suspend() / Resume() snapshot the child threads; a thread created during enumeration may be missed.CreateProcessW; a short inheritance window exists during creation.Device stores only the caller accessor. Kind/Access/Throughput/Window are valid only when the Device converts to true.Directory / File / Host / ThisThread LastError() is thread_local inside this module, exposed by an exported getter. Do not put thread_local in a public header.StormByte::String::String / CString.Process waits if the child is still owned. Move invalidates the source.Enable tests in CMake (ENABLE_TEST) and run CTest from the build tree. Device, Directory, File, Host and ThisThread print probe data and always return success (the machine is not a fixture). Process tests assert error codes. Use ctest -V to see stdout.
Issues and pull requests belong on this repository. Fork and open a PR against master.
Read CONTRIBUTING.md before you send a patch (copyright assignment and review rules). Coding rules are in CODING_STYLE.md when that file exists.
Original StormByte-System sources are dual-licensed: GNU Lesser General Public License v3 or later or a commercial license from the copyright holder (David C. Manuelda Storm.nosp@m.Byte.nosp@m.@gmai.nosp@m.l.co.nosp@m.m).
The grant applies only to original StormByte-System source in this repository. It does not cover other StormByte modules or third-party material shipped here (including everything under thirdparty/), which remains under its own license. Neither license grants patent rights.
See [LICENSE](LICENSE) for the dual-license notice and COPYING.LGPLv3 for the full GNU LGPL version 3 text. Also https://www.gnu.org/licenses/lgpl-3.0.html.
Static linking under the LGPL is described under Installation.
StormByte is developed in spare time. Sponsorship is optional and does not buy features, priority or support.