Reads a file synchronously and returns its contents as a string.
Returns an empty string if the file cannot be read.
File path string or Gio.File object
The file contents, or '' on error
''
const content = readFile('/etc/hostname'); Copy
const content = readFile('/etc/hostname');
Reads a file synchronously and returns its contents as a string.
Returns an empty string if the file cannot be read.