- May
- 13,813
- 211
The help says the reference filename must immediately follow /R. The examples show an intervening space. How it actually works seems to depend on whether /R has a modifier (acw).
Here, no modifier and a space, it seems to have done the right thing (modified the write time on 2.txt to match that of 1.txt). It's the same without a space.
Now lets throw put a modifier on /R. When there's a space, it seems /R is ignored, and both files are touched and get the current time as write time.
With a modifier and no space, only one file is touched (good) but it gets the current time as write time (so the reference file was somehow ignored).
It doesn't seem to be working well.
I don't see how no_space can ever work with a modifier. What would "/Rabc.txt" mean? Is the switch "/Ra" and the file "bc.txt" or the switch "/R" and the file "abc.txt"? (DWIM parser required here.)
P.S. The last test is the same even if I try to be more precise:
Here, no modifier and a space, it seems to have done the right thing (modified the write time on 2.txt to match that of 1.txt). It's the same without a space.
Code:
v:\touchtest> do f in *.txt ( echo %f & do i in /c caw ( echo %i %@filedate[%f,%i] %@filetime[%f,%i] ))
1.txt
c 2013-07-05 12:57
a 2013-07-05 12:57
w 2013-07-05 13:10
2.txt
c 2013-07-05 12:57
a 2013-07-05 12:57
w 2013-07-05 13:11
v:\touchtest> touch /r 1.txt 2.txt
2013-07-05 13:10:49.955 V:\touchtest\2.txt
v:\touchtest> do f in *.txt ( echo %f & do i in /c caw ( echo %i %@filedate[%f,%i] %@filetime[%f,%i] ))
1.txt
c 2013-07-05 12:57
a 2013-07-05 12:57
w 2013-07-05 13:10
2.txt
c 2013-07-05 12:57
a 2013-07-05 12:57
w 2013-07-05 13:10
Now lets throw put a modifier on /R. When there's a space, it seems /R is ignored, and both files are touched and get the current time as write time.
Code:
v:\touchtest> touch /rc 1.txt 2.txt
2013-07-05 13:21:35.165 V:\touchtest\1.txt
2013-07-05 13:21:35.165 V:\touchtest\2.txt
v:\touchtest> do f in *.txt ( echo %f & do i in /c caw ( echo %i %@filedate[%f,%i] %@filetime[%f,%i] ))
1.txt
c 2013-07-05 12:57
a 2013-07-05 12:57
w 2013-07-05 13:21
2.txt
c 2013-07-05 12:57
a 2013-07-05 12:57
w 2013-07-05 13:21
Code:
v:\touchtest> touch /rc1.txt 2.txt
2013-07-05 13:24:38.498 V:\touchtest\2.txt
v:\touchtest> do f in *.txt ( echo %f & do i in /c caw ( echo %i %@filedate[%f,%i] %@filetime[%f,%i] ))
1.txt
c 2013-07-05 12:57
a 2013-07-05 12:57
w 2013-07-05 13:21
2.txt
c 2013-07-05 12:57
a 2013-07-05 12:57
w 2013-07-05 13:24
It doesn't seem to be working well.
I don't see how no_space can ever work with a modifier. What would "/Rabc.txt" mean? Is the switch "/Ra" and the file "bc.txt" or the switch "/R" and the file "abc.txt"? (DWIM parser required here.)
P.S. The last test is the same even if I try to be more precise:
Code:
touch /rc"1.txt" 2.txt