4 stable releases

1.1.2 Jul 24, 2024
1.1.1 Jul 17, 2024
1.1.0 Jul 13, 2024
1.0.0 Jun 28, 2024

#150 in Filesystem

39 downloads per month

MIT/Apache

22KB
415 lines

FAST touch(1) file utility for CI jobs

MIT/Apache License Crates.io Version Crates.io MSRV Lines of code Crates.io Downloads

This is Rust rewrite of classic POSIX touch(1) file utility for changing file timestamps. The touch utility modifies file timestamps, allowing you to change access and modification times. See manpage of GNU coreutils version. Works natively on Windows and Unix.

This Rust performance rewrite version uses tokio multi threaded backend for processing multiple files concurrently which gives it major speedups compared to other touch programs. This is especially visible when working on network attached NFS or SMB drives. This speedups makes it highly suitable for use in CI jobs, where you are billed per second.

For filename mask specification touch-cli uses glob format from glob crate. Glob format supports recursive touch (example: **/*.d) It allows you to update timestamps for files within subdirectories as well.

Command Line parameters

Glob patterns and following options are supported as command line arguments. Program uses getopt3 for options parsing, which have support for some extended parsing features such as grouping of options.

  1. -c do not create any files
  2. -a change only the access time
  3. -m change only the modification time
  4. -f ignored
  5. -v output version and exit

Default is to create new files and change both access and modification times.

Exit values

  1. Task completed without errors
  2. No mandatory file or pattern command line arguments supplied
  3. Glob command line expressions is wrong. Check proper syntax of glob pattern.
  4. Error while applying changes to file system

Dependencies

~2.3–4MB
~65K SLoC