i would like to know which is the best way to copy large number of files.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re copying files locally, you should use FileChannel.transferFrom() or FileChannel.transferTo(). For example:
On many platforms, the copying will happen via DMA and be about as fast as possible.
If you’re copying files over a network, then you’re in a different situation. In the case that some of the files might already exist, then you should look into rsync, as it can avoid transferring parts of files which are the same on both sides. If the most common case is that the files won’t already exist on the destination machine, then you’ll want to use something like scp. For that, see this question.