WAD move /s regression from tcc15

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Dec 10, 2014
63
1
#1
When trying to move files in subdirectories, tcc16/17 only move the one from the first dir and then stop if the directory contains multiple files. Try this batch to reproduce, tcc16/17 only move "x.txt" while tcc15 and tcc-le move all three .txt files as requested

mkdir bug\1 bug\2
cd bug\1
touch /c a\x.txt a\x.bat b\y.txt b\y.bat c\z.txt c\z.bat
move *.txt ..\2 /s
cd ..\..
 
#2
I see the same thing plus a message that a directory is not empty???????
Code:
v:\empty\bug\1> move /s *.txt ..\2\
TCC: (Sys) The system cannot find the file specified.
 "V:\empty\bug\1\*.txt"
V:\empty\bug\1\a\x.txt -> V:\empty\bug\2\a\x.txt
TCC: (Sys) The directory is not empty.
 "V:\empty\bug\1\a"
  1 file moved
 

rconn

Administrator
Staff member
May 14, 2008
10,096
85
#5
When trying to move files in subdirectories, tcc16/17 only move the one from the first dir and then stop if the directory contains multiple files. Try this batch to reproduce, tcc16/17 only move "x.txt" while tcc15 and tcc-le move all three .txt files as requested

mkdir bug\1 bug\2
cd bug\1
touch /c a\x.txt a\x.bat b\y.txt b\y.bat c\z.txt c\z.bat
move *.txt ..\2 /s
cd ..\..
Your syntax is incorrect. Change your MOVE line to:

move /s /ne *.txt ..\2

and MOVE will move all of the matching files. Without the /ne, MOVE will abort on "no matching files in this directory" or "the directory is not empty" errors.
 
Dec 10, 2014
63
1
#6
Your batch file won't work in TCC/LE or TCC v15, because they'll fail on the TOUCH command (they don't support creating subdirectories with TOUCH /C).
This was a case of over-simplification on my part - the actual batch file I ran contained mkdir commands, but I removed them before attaching it here.

Without the /ne, MOVE will abort on "no matching files in this directory" or "the directory is not empty" errors.
Thanks!