D
Danger_Duck
So like, I know that when you copy a file, you do something along the
lines of:
FileChannel ic = new FileInputStream("source.txt").getChannel();
FileChannel oc = new FileOutputStream("target.txt").getChannel();
ic.transferTo(0, ic.size(), oc);
ic.close();
oc.close();
However, I have no intention of copying a file-at the end of my
program, I'd like to rename one file and move another. How do I
accomplish this?
By the way, I tried something along the lines of:
res.renameTo(new File(resultsLocation.concat("/" + test.getName() +
"_results.txt")));
so could someone explain the proper way to use the method or recommend
a better one?
Thanks!
(Again, just how to MOVE and RENAME a file on the hardisk through
Java)
-The Duck
lines of:
FileChannel ic = new FileInputStream("source.txt").getChannel();
FileChannel oc = new FileOutputStream("target.txt").getChannel();
ic.transferTo(0, ic.size(), oc);
ic.close();
oc.close();
However, I have no intention of copying a file-at the end of my
program, I'd like to rename one file and move another. How do I
accomplish this?
By the way, I tried something along the lines of:
res.renameTo(new File(resultsLocation.concat("/" + test.getName() +
"_results.txt")));
so could someone explain the proper way to use the method or recommend
a better one?
Thanks!
(Again, just how to MOVE and RENAME a file on the hardisk through
Java)
-The Duck