Logo

Programming-Idioms

# 347 Copy folder
Copy the directory path1 to path2, with all its contents
New implementation

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating material.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
import "os"
err := os.CopyFS(path2, os.DirFS(path1))
FileUtil
CopyDirTree(path1,path2,[]);
import shutil
shutil.copytree(path1, path2)
require "fileutils"
FileUtils.copy_entry(path1, path2)