hammerspoon2-docs
    Preparing search index...

    Function read

    • Read part or all of a file as a UTF-8 string.

      Parameters

      • path: string

        Path to the file. ~ is expanded.

      • offset: number

        Byte offset to start reading from. Pass 0 (or omit) to read from the beginning.

      • length: number

        Maximum number of bytes to read. Pass 0 (or omit) to read to the end of the file.

      Returns string | null

      The file contents as a UTF-8 string, or null if the file cannot be read.