Answers for "command to copy file from one directory to another"


java copy file from one directory to another efficiently

private static void copyFileUsingStream(File source, File dest) throws IOException {
    InputStream is = null;
    OutputStream os = null;
    try {
        is = new FileInputStream(source);
        os = new FileOutputStream(dest);
        byte[] buffer = new byte[1024];
        int length;
        while ((length = > 0) {
            os.write(buffer, 0, length);
    } finally {
Posted by: Guest on March-04-2020

copy directory with files

cp -r source_folder destination/path
Posted by: Guest on March-04-2021

copy multiple files from one folder to another folder

import shutil
import os

dst_dir = "your_destination_dir_path"
for f in os.listdir():
    shutil.copy(f, dst_dir)
Posted by: Guest on April-18-2021

Code answers related to "command to copy file from one directory to another"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language