This is a Rust implementation for Windows of the touch
command found on UNIX-like operating systems.
Important
This is code written by a beginner in Rust for learning purposes. I'm sure the experienced Rustaceans here know better ways to write it. If that's the case, I would be grateful if you could kindly offer advice through the Issues section.
$ touch <file…>
If the file specified in the argument does not exist, it will be created. If the file already exists, its timestamp will be updated.
You can also list multiple files in the argument.
If you specify the option c
, the file will not be created if it does noe exist.
If it already exists, the timestamp will be updated as usual.
Specifies the timestamp.
Set the timestamp to the same time as another file.
Tip
The d and r options cannot be specified at the same time.
It is recommended that you use the most recent release, excluding pre-releases.
PS C:\> cd '.\Program Files\'
PS C:\Program Files> mkdir touch-for-windows
Directory: C:\Program Files
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 0/0/0000 00:00 PM touch-for-windows
PS C:\Program Files> mv ~\Downloads\touch.exe .
You must run with administrator to place it in C:\Program Files
,
and although the examples use C:\Program Files
, it is not necessary to place it there.