By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,655 Members | 1,875 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,655 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.