Unable to rename folderName to foldername: folderName exists.


  • Considered Harmful

    Here Microsoft Visual Studio 2005 tells me I cannot change the casing of the folder name because a folder (the same one I'm renaming) exists with that name.  Of course it exists; how else could I rename it?  All renames to permutations of casing result in this error.  A folder name shouldn't collide with itself!

    I guess I'll name it Mediachase2, then remove the 2...  That worked, but it's still braindead.



  • Yeah, i have this all the time in 2K when I want to rename FOldername to Foldername. I think it's due to the way that NTFS preserves casing, but is case insensitive. Presumably it's something that was never tested for. Just tried it in Vista and recasing seems to work now.



  • Case insensitivity ftw \o/



  • @RayS said:

    Yeah, i have this all the time in 2K when I want to rename FOldername to Foldername. I think it's due to the way that NTFS preserves casing, but is case insensitive. Presumably it's something that was never tested for. Just tried it in Vista and recasing seems to work now.

    I just successfully renamed a file from "test.xps" to "Test.xps" on my desktop under XP Pro SP2; I think it's been fixed for a while. (If memory servers, XP introduced a new version of NTFS, so it was probably fixed then). On the other hand, I can't have "test.xps" and "Test.xps" in the same folder.



  • I remember having a similar issue with my mp3 player - my (ext3) computer had a folder named artist and one named Artist - trying to copy them to the (fat) player resulted in only the first being copied.

    To the OP: are you positive you don't already have both folders - foldername and folderName ?



  • @Cloaked User said:

    On the other hand, I can't have "test.xps" and "Test.xps" in the same folder.


    <FONT face=tahoma,arial,helvetica,sans-serif>And you still can't create a file named "test.xps" if there is a folder named "test.xps" beside it... I wonder why...



    </FONT>


  • Considered Harmful

    @Cloaked User said:

    @RayS said:

    Yeah, i have this all the time in 2K when I want to rename FOldername to Foldername. I think it's due to the way that NTFS preserves casing, but is case insensitive. Presumably it's something that was never tested for. Just tried it in Vista and recasing seems to work now.

    I just successfully renamed a file from "test.xps" to "Test.xps" on my desktop under XP Pro SP2; I think it's been fixed for a while. (If memory servers, XP introduced a new version of NTFS, so it was probably fixed then). On the other hand, I can't have "test.xps" and "Test.xps" in the same folder.

    It's a Visual Studio bug, not a Windows bug, which makes it all the more WTF.  It should just try it and report an error on failure, rather than trying to predict an error that wouldn't actually happen if it just called the API.


  • Considered Harmful

    @m0ffx said:

    I remember having a similar issue with my mp3 player - my (ext3) computer had a folder named artist and one named Artist - trying to copy them to the (fat) player resulted in only the first being copied. To the OP: are you positive you don't already have both folders - foldername and folderName ?

    Yes.  As I said, adding a 2 then removing the 2 made it possible.  The source folder no long had the "same name" as the destination folder.  It's an extra step that was entirely unnecessary, though.  I could have done it directly in one step through Windows Explorer but I didn't feel like navigating all the way there when I already had it open in the IDE.



  • @xrT said:

    <font face="tahoma,arial,helvetica,sans-serif">I wonder why...
    </font>
    Because a folder is a file with slightly different attributes.



  • Yes, but that's just an "implementation detail" that shouldn't be exposed to the end user.  There is no logical reason why you couldn't have both, just an implementation reason.



  • @DWalker59 said:

    Yes, but that's just an "implementation detail" that shouldn't be exposed to the end user.  There is no logical reason why you couldn't have both, just an implementation reason.

    Logically, files and folders in a directory share the same namespace. How else ought one distinguish between them? By the icon? By forcing people to append a \ (or a /) on the end of directories?



  • Sure!  Either way.  Well, maybe not.


Log in to reply