I want to copy a file from one directory to another. I read thread269-317473, which explains how to use the renameTo method on the File class, but renameTo moves a file instead of copying it.
I looked at the API specs for the FILE class and saw the following constructor:
The documentation is not entirely clear on what the method does -- I was thinking it performs a copy operation, but I tested it and the file is not copied.
1) Can anyone provide insight on what the method does?
2) Outside of opening a file and copying a file byte by byte, is there a way copy a file?
Thanks.
I looked at the API specs for the FILE class and saw the following constructor:
Code:
File( File parent, String child)
The documentation is not entirely clear on what the method does -- I was thinking it performs a copy operation, but I tested it and the file is not copied.
1) Can anyone provide insight on what the method does?
2) Outside of opening a file and copying a file byte by byte, is there a way copy a file?
Thanks.