473,406 Members | 2,439 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,406 software developers and data experts.

Anyway to rename a current File with out creating a new File object.

Basically I have this little program that will look through directories and
rename any file it finds. The renaming that takes place is like removing of
dashes or Caps the first letter from each word and so on. Is there a better
way to rename the files instead of creating a new file and calling
originalFile.renameTo(new File(newFilename)); Basically I want to know if
creating this new File each time will be costly in both memory and time when
I run the program on hundreds of files. Is there some way to just change the
string of the current file without creating a totally new file?
Thanks Alot

Jul 17 '05 #1
1 1783
Liz
pls don't xpost

"C-man" <ia********@shaw.ca> wrote in message
news:DE2cc.10974$J56.2402@edtnps89...
Basically I have this little program that will look through directories and rename any file it finds. The renaming that takes place is like removing of dashes or Caps the first letter from each word and so on. Is there a better way to rename the files instead of creating a new file and calling
originalFile.renameTo(new File(newFilename)); Basically I want to know if
creating this new File each time will be costly in both memory and time when I run the program on hundreds of files. Is there some way to just change the string of the current file without creating a totally new file?
Thanks Alot

Jul 17 '05 #2

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

Similar topics

26
by: Michael Strorm | last post by:
Hi! I posted a message a while back asking for project suggestions, and decided to go with the idea of creating an adventure game (although it was never intended to be a 'proper' game, rather an...
7
by: Tom | last post by:
I'm having a problem using a path with spaces as a parameter to os.rename() in a program on WinXP. This works fine at the command line (where the folder "c:\aa bb" exists) > os.rename( "c\aa...
3
by: Saradhi | last post by:
Hi All, Here I am facing a performance problem with the TreeView Node renaming. I am displaying a hierarchy Data in a treeview in my Windows C# Application. My tree view represents an...
5
by: jez123456 | last post by:
Hi, I’ve written a c# program to compact certain msaccess databases. The way this works is to compact say C:\test1.mdb to C:\temp.mdb, then delete C:\test1.mdb and rename C:\temp.mdb as...
3
by: Erik Foreman | last post by:
I am using a folderbrowserdialog object to prowse to a folder then once in that folder I am going to have my program rename all of the files in that folder. I know the rename funchtion but I am not...
1
by: Wolfgang Meister | last post by:
Assume the current name of my project is "mytestroj". A couple of project files are named with this stem name like mytestproj.sln, mytestproj.suo, mytestproj.csproj,.... How can I rename my...
5
by: mythili123 | last post by:
The script will rename all files in the current directory whose names contain the first argument by replacing that part of the filename with the second argument. so far i could just get the file...
2
by: newyorker213 | last post by:
Hello, We have files ( named in the following format ) in one of our folders: MV0001.XLS MV0002.XLS and so on WV0001.XLS WV0002.XLS
1
by: Alien | last post by:
Hi, I am new to PHP and trying to move a zip file from one directory to another. I researched on the web on this and all fingers pointed to this rename() function. I tried writing a PHP script...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.