hammerspoon2-docs
    Preparing search index...

    Function touch

    • Set the access and modification times of a file, creating it if it does not exist (equivalent to the POSIX touch command). The argument order matches Hammerspoon v1 (LuaFileSystem) and Node's fs.utimes: access time first.

      Parameters

      • path: string

        Path to the file. ~ is expanded.

      • OptionalaccessDate: number

        Seconds since the Unix epoch (fractions allowed). Defaults to now.

      • OptionalmodificationDate: number

        Seconds since the Unix epoch (fractions allowed). Defaults to accessDate.

      Returns boolean

      true on success, false on failure (including EINVAL for a NaN, infinite, or out-of-range timestamp).