REN bug

Jun 24, 2008
223
0
Siegen, Germany
Using version 12.10-0.58 and trying to execute the below commands:

mkdir x
ren x "x [y]"


I receive the following error message:

TCC: (Sys) The system cannot find the file specified.
"E:\temp\down\x"


This doesn't happen for plain files:

> x
ren x "x [y]"


E:\temp\down\x -> E:\temp\down\x [y]
1 file renamed


nickles
 
May 20, 2008
12,178
133
Syracuse, NY, USA
See REN's "/S" option. Apparently it's seeing "[x]" as a wildcard.


On Sun, 27 Mar 2011 14:25:21 -0400, nickles <> wrote:

|Using version 12.10-0.58 and trying to execute the below commands:
|
|mkdir x
|ren x "x [y]"
|
|I receive the following error message:
|
|TCC: (Sys) The system cannot find the file specified.
| "E:\temp\down\x"
|
|This doesn't happen for plain files:
|
|> x
|ren x "x [y]"
|
|E:\temp\down\x -> E:\temp\down\x [y]
| 1 file renamed
|
|nickles
 

rconn

Administrator
Staff member
May 14, 2008
12,557
167
> Which it shouldn't (as it isn't). It used to work in prior versions!

Not in anything recent -- that code hasn't changed in at least a couple of
years. REN has *always* required a /S to rename directories, though
sometimes (but only recently) it is able to guess that you're trying to
rename a directory.

There's no way for the parser to automagically know whether you want []
characters to be wildcards or literal characters. See the help for REN when
renaming directories to targets with wildcards.

Rex Conn
JP Software
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,689
106
Albuquerque, NM
prospero.unm.edu
On the other hand, bracket wildcards make no sense in REN's new_name parm anyway. Maybe COPY's target filename too, and a few other places? Perhaps in some future version, these commands could check only for simple wildcards (question marks and asterisks) in target parameters?
 
Jun 24, 2008
223
0
Siegen, Germany
move works w/o problems.

Also, the behavior is inconsistent with renaming files (see first post).
Also - as I've used this exact syntax quite often before - I'm pretty sure (not keeping old versions) that it worked before 12.10.

nickles
 

rconn

Administrator
Staff member
May 14, 2008
12,557
167
move works w/o problems.

Also, the behavior is inconsistent with renaming files (see first post).
Also - as I've used this exact syntax quite often before - I'm pretty sure (not keeping old versions) that it worked before 12.10.

I tried it back on versions to 8.0 and it didn't work (as expected) without the /S option on any of them.

I suspect that either you had an alias in the past, or you weren't using the square brackets.
 
Jun 24, 2008
223
0
Siegen, Germany
Also - because I used to rename files instead of directories - call me a blockhead ;-)

Sorry for that.

But - this behavior is not consistent with cmd and - from my point of view - generally "nasty" (as unexpected):

ren "some name" "some name [details]" would give my an error when being a directory, not however when being a file.
 

rconn

Administrator
Staff member
May 14, 2008
12,557
167
But - this behavior is not consistent with cmd and - from my point of view - generally "nasty" (as unexpected):

ren "some name" "some name [details]" would give my an error when being a directory, not however when being a file.

The only way to make it consistent with CMD would be to eliminate extended wildcards (which CMD doesn't support).
 
Jun 24, 2008
223
0
Siegen, Germany
@rconn

Move uses these too, doesn't it?

Maybe there should be a switch allowing us to turn on/off extended wildcards?

Is there a setdos option?

nickles
 

Similar threads