About Question enthuware.ocpjp.v8.2.1401 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
lveto15
Posts: 27
Joined: Tue Sep 22, 2015 1:01 pm
Contact:

About Question enthuware.ocpjp.v8.2.1401 :

Post by lveto15 »

Presented code doesn't work exactly as explain in the question.

Code: Select all

File newfile = new File(oldfilename+".checked");
boolean b = oldFile.renameTo(newFile);
It renames file, but also moves it to the directory in which this code is executed.

Since subdirectories shouldn't be processed something like this can be done:

Code: Select all

String newName = args[0]+"/"+oldfilename;
File newfile = new File(newName+".checked");
boolean b = file.renameTo(newfile);

admin
Site Admin
Posts: 10402
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1401 :

Post by admin »

You are right. Fixed.
thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests