readSysFile

fnstring readSysFile(string path) @safe nothrow

Reads a /sys file and returns its content.

This is a helper function for reading /sys files safely.

Parameters

pathPath to the /sys file.

Returns

File content as a string, or empty string if file doesn't exist.

Example:

auto content = readSysFile("/sys/class/net/eth0/operstate");