... | ... | @@ -232,7 +232,10 @@ let [minimumSize, naturalSize] = label.get_preferred_size(); |
|
|
try {
|
|
|
let file = new Gio.File({ path: '/proc/cpuinfo' });
|
|
|
let [ok, contents, etag_out] = file.load_contents(null);
|
|
|
log(ok ? contents : 'Failed to read file: unknown error');
|
|
|
// "ok" is actually useless in this scenario, since if it is false,
|
|
|
// an exception will have been thrown. You can skip return values
|
|
|
// you don't want with array elision:
|
|
|
let [, contents2] = file.load_contents(null);
|
|
|
} catch(e) {
|
|
|
log('Failed to read file: ' + e.message);
|
|
|
}
|
... | ... | |