hammerspoon2-docs
    Preparing search index...

    Function tempFile

    • Create and open a new, uniquely named temporary file. The file is created in hs.fs.tempDirectory() with permissions 0o600 and opened in "w+" mode, so its path always starts with hs.fs.tempDirectory(). It is not deleted automatically; call remove() on it when you no longer need it on disk.

      Parameters

      • Optionalprefix: string

        A prefix for the file name. Must not contain /. Defaults to "hs".

      Returns HSFile | null

      An HSFile, or null on failure (see hs.fs.lastError).