OptimizedFileReader.readKeyValuePairs

string[string] readKeyValuePairs(string path, char separator = ':') @safe

Reads a file and parses it as key-value pairs.

This is optimized for /proc files with key: value format.

Parameters

pathPath to the file to read
separatorCharacter that separates keys from values (default: ':')

Returns

Associative array of key-value pairs

Throws

OptimizationException if the file cannot be read