473,385 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Renaming a File Folder? (same name but DiFeReNt CaSe)

Joe
How can I rename a folder that has the same name, but with different
character casing? When I do either of the following, I get an error saying
"Source and destination path must be different.":

Directory.Move("C:\\test1", "C:\\TEST1");

or

DirectoryInfo di = new DirectoryInfo("C:\\test1");
di.MoveTo("C:\\TEST1");

This behavior is different from the File class that allows filenames to be
renamed successfully this way. Windows Explorer allows one to re-case a
folder name without a problem. Do I have to resort to renaming the
directory to a temporary name and then rename it back?

Joe
Jul 21 '05 #1
0 1269

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Richard L Rosenheim | last post by:
Correct me if I'm wrong... It appears that out of the 1800+ classes in the .Net framework, there isn't a file rename method (discounting the rename function in the vb namespace). And that the...
1
by: Ocean | last post by:
Helo, anybody know how you can secure file; so give permissons for some users any take everyone to off? Example: I have server extension folders and in many cases in more debth....
0
by: MikeY | last post by:
Hopefully someone can help, I have a listview box where I display my desired files. I single click on the desired file to be renamed and I rename it with a new name. My problem arises when the...
1
by: Don Leverton | last post by:
Hi Folks, I have been given a CD with approx 130 .xls files (bean-counters!) that I would like to import and merge to ONE table (tblTradeshow). The XL files are *similarly*, but not...
2
by: cloudx | last post by:
Hi there, it is driving me crazy. Aftering renaming app.config the following code I always get null on myApp. It works if I keep the name app.config. Why? string myApp =...
3
by: MisterG | last post by:
Hi, In my code, I rename a folder and then the asp.net application restarts ! So i've lost my session variables ... How is it possible for the application asp.net to restart when you rename a...
6
by: I_AM_DON_AND_YOU? | last post by:
I have a small VB.Net Solution. The solution has filename LABELMAKER.SLN and the the project has filename LABELMAKER.VBPROJ. There is another file LABELMAKER.VBPROJ.USER. All these are in a...
0
by: Joe | last post by:
How can I rename a folder that has the same name, but with different character casing? When I do either of the following, I get an error saying "Source and destination path must be different.": ...
7
by: Adam | last post by:
Hello. I do most of my web dev work from a Mac (whose file system is case-insensitive.) I upload my web pages and other files onto a Unix-based host, which is case sensitive. When I look at the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.