KeyValue icon

KeyValue

Store and retrieve key-value pairs on the filesystem

Actions20

Record → Touch

AI-generated

Summary

Update the timestamp (access and modification time) of a record file within a specified directory, creating the record if it does not already exist.

Inputs

  • Directory Name (required) — Name of the directory containing the record to touch.
  • Key (required) — The key (filename) of the record whose timestamp will be updated or that will be created if absent.

Output shape

a list containing a JSON object per input item indicating the directory name, key, and flags for whether the record was touched and whether it was created.

If the record file already exists, its timestamps are updated and the output includes 'touched: true' and 'created: false'. If the record does not exist, an empty file is created, its timestamps are set, and output includes 'touched: true' and 'created: true'. The directory will be created if missing. Errors halt execution unless 'Continue On Fail' is enabled.

Examples

Example 1: Touch an existing record to update its timestamp

Set 'Directory Name' to the target directory and 'Key' to the existing record filename. The node updates the file's access and modification times.

Example 2: Create a new record file and touch it if it does not exist

Set 'Directory Name' to the desired directory and 'Key' to a new record filename. The node creates the record as an empty file and sets its timestamps.

Links

Discussion