Re: Renaming a directory to all uppercase on Windows?



On Dec 11, 11:48 am, APN <palm...@xxxxxxxxx> wrote:
On Dec 11, 3:33 pm, "Donal K. Fellows" <donal.k.fell...@xxxxxxxxx>
wrote:

walton.p wrote:
But, of course, this is a hack. And it takes twice as long. Am I
missing something?

No. It's how life is on Windows. (You have the same restriction in
Explorer too.)

Donal.

Nope, Explorer will allow you to change the case of a file/dir name,
at least on XP.

The basic issue is that the file rename command sees FOLDER exists
(actual name folder) and as per its documented behaviour assumes you
are trying to move the source file into that directory. Given the
source is folder itself, it complains about moving a directory onto
itself.

IMHO, the semantics of "file rename", which probably came from the
unix mv command, are broken. But it is behaving as documented.

/Ashok

Yep, that's exactly it. Thank you for that explanation, Ashok.

It's obvious that this "file rename" behavior was intended for a case-
sensitive filesystem. The fix should be simple... ie., If string eq -
nocase $source $target, then use the first documented "file rename"
behavior when on a case-insensitive OS.
.



Relevant Pages

  • Re: Renaming a directory to all uppercase on Windows?
    ... Nope, Explorer will allow you to change the case of a file/dir name, ... The basic issue is that the file rename command sees FOLDER exists ... are trying to move the source file into that directory. ...
    (comp.lang.tcl)
  • Re: Renaming a directory to all uppercase on Windows?
    ... a retardedly easy thing to fix. ... The problem is in the design of the ... "Folder" instead of trying to move the directory into itself. ... Tcl's [file rename] doesn't support an operation ...
    (comp.lang.tcl)
  • Renaming a directory to all uppercase on Windows?
    ... This seems impossible with the [file rename] command. ... file rename -force folder FOLDER ... This is because on Windows, file names are not case sensitive. ...
    (comp.lang.tcl)
  • Re: File Naming Problem...
    ... which explorer will tell you is an illegal file name. ... |>allocation tables because they are trying to allocate a file with no name, ... Prev by Date: ...
    (microsoft.public.windowsxp.general)
  • File Naming Problem...
    ... There is a program called Better File Rename that will allow you to rename a ... which explorer will tell you is an illegal file name. ... allocation tables because they are trying to allocate a file with no name, ... Prev by Date: ...
    (microsoft.public.windowsxp.general)