Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Fixed Bug in RENAME Commands

Jun
762
16
For file renames that change only the case of the name, RENAME throws an error message when the /N switch is included.

TCC(30.00.18): C:\temp\sandbox>dirx & *rename /n B b & dirx
1
2
A
a b
B
C:\temp\sandbox\B -> C:\temp\sandbox\b
TCC: (Sys) Cannot create a file when that file already exists.
"C:\temp\sandbox\b"
0 files would be renamed
1
2
A
a b
B

Without the /N switch, it performs the operation that changes the case.

TCC(30.00.18): C:\temp\sandbox>dirx & *rename B b & dirx
1
2
A
a b
B
C:\temp\sandbox\B -> C:\temp\sandbox\b
1 file renamed
1
2
A
a b
b

This is a real error, not just a reporting peculiarity, as I noted in the thread about the DIR command and regular expressions.
 
REN has behaved this way for about 30 years.

The issue here is two-fold: first, Windows filenames are case insensitive, and second, the Windows API did not support changing case in an otherwise identical filename. 4DOS / 4NT / TCC had to jump through some hoops to do that (doing a double rename). More recently Windows now actually allows you to do that, but the old /N code in REN wasn't updated to take advantage of that.

I have made a change in 30.0.19 to support it.
 
Back
Top