Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

util-timestamp-suffix

Small CLI utility that watches the current directory and appends a timestamp suffix to newly created files.

Specification

  • Watches current directory for CREATE events.
  • 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.

Usage

Build the binary:

go build -o util-timestamp-suffix main.go

Run the utility:

./util-timestamp-suffix [options]

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"

Why and when this tool is useful

Prevents accidental file overwriting when saving files with the same name in the same directory. Automatically ensures unique filenames by appending a timestamp suffix.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Small CLI utility that watches the current directory and appends a timestamp suffix to newly created files.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages