Skip to main content

Rename File

Category: Files Rename File block screenshot

Renames one file by keeping its current parent folder and replacing only the leaf name with `newName`. If `overwrite` is false, the block fails when the target name already exists in the same folder. Use `pathChangeExtension` first when the new name should be derived from the existing file name.

Inputs

InputRequiredValue KindTypesEnum Values
pathyesexpressionstring
newNameyesexpressionstring
overwritenoexpression

Notes

  • Filesystem read/write statement that keeps the current parent folder and replaces only the leaf name.
  • Fails on existing targets unless overwrite=true.

Examples

Rename File By Changing Extension

Builds a new leaf name from the original file name without extension, then renames the file inside its current parent folder.

kind: Pattern · format: runtime-dsl · validation: Schema only

Topics: files, path handling

Source: patterns/ex-files-rename-by-changing-extension.json

Download JSON