RAGS - v1.10.0
    Preparing search index...

    Function readFile

    • Reads a file synchronously and returns its contents as a string.

      Returns an empty string if the file cannot be read.

      Parameters

      • file: string | File

        File path string or Gio.File object

      Returns string

      The file contents, or '' on error

      const content = readFile('/etc/hostname');