#file-utility #file #touch #file-processing #file-access #utility #command-line

app touch-cli

Fast, Parallelized touch(1) file utility

5 stable releases

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

#191 in Filesystem

MIT/Apache

22KB
416 lines

FAST touch(1) file utility for CI jobs

Crates.io Version MIT/Apache License Crates.io MSRV Safe Rust 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–8MB
~64K SLoC