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

renameTo

hai everyone...

i need your help..
i'm using a simple method to rename a bunch of images in a folder order by its name (eg: A001.jpg,B001.jpg,C001.jpg). Im using the renameTo method, but it has a problem. It does not change the name of the images.

Here is my code:

for (int a = 0; a<i;a++){
if (!qAnswers[a].equals(answerOptionAlphaArray[a])){
if (qAnsS[a] != ""){
File currentAnswerFile1 = new File(filePath, ""+qAnswers[a] +""+qID+"."+currentAnswerFormat+"");
File currentAnswerFile3 = new File(filePath, ""+answerOptionAlphaArray[a]+""+qID+"."+currentAnswerFormat+"");
currentAnswerFile3.delete(); currentAnswerFile1.renameTo(currentAnswerFile3);
}

}
}
May 19 '06 #1
0 1212

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: John Bowling | last post by:
I'm creating a routine (not in a browser) to move multiple files on a daily basis to a backup directory. It can be done easily by call shell functions like 'mv file* newdir'. I can't find any...
3
by: Tejus | last post by:
Hi All, A strange problem in java on unix. When i use File.renameTo(File) to move a file from one location to another,it does not work if I try to move to a different partition. or (a file...
1
by: C-man | last post by:
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...
48
by: Joseph | last post by:
Hi I'm writing a commercial program which must be reliable. It has to do some basic reading and writing to and from files on the hard disk, and also to a floppy. I have foreseen a potential...
0
by: sakurasyi | last post by:
hai everyone... i need your help.. i'm using a simple method to rename a bunch of images in a folder order by its name (eg: A001.jpg,B001.jpg,C001.jpg). Im using the renameTo method, but it has a...
3
by: krishindevnet | last post by:
Hi , I am working on a project which has editor which generates the document templates in HTML .I am required to convert these HTML templates to dot file extension . If anybody knows about that...
7
by: akoymakoy | last post by:
Hi what do i have to use in order to browse for a jpeg.file and save it to a specific directory... and overwrite the existing and does it only work for jpeg? or any kind of file thanks in...
6
by: chrisbirk | last post by:
Hi! I want to write an application on windows xp, which iterates n times a model script (exe) and copies every single run the results (multiple files such as text, maps, subfolders,etc) from the...
8
by: itsraghz | last post by:
Hi , While looking at this thread http://bytes.com/forum/showthread.php?threadid=851452 , just got to know about the new method "renameTo()". Was wondering for having missed this and wanted to...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.