Small CLI utility that watches the current directory and appends a timestamp suffix to newly created files.
- Watches current directory for
CREATEevents. - Ignores directories.
- Waits for a configurable duration after creation before renaming to avoid touching files still being written.
- Renames files by inserting a timestamp before the extension.
for more details, see docs/SPECS.md.
Build the binary:
go build -o util-timestamp-suffix main.goRun the utility:
./util-timestamp-suffix [options]-wait: Wait time in seconds before renaming (default:5)-format: Timestamp format layout (default:2006_0102_150405)
Example:
./util-timestamp-suffix -wait 2 -format "20060102-1504"Prevents accidental file overwriting when saving files with the same name in the same directory. Automatically ensures unique filenames by appending a timestamp suffix.
This project is licensed under the MIT License - see the LICENSE file for details.