Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!

Idiom #347 Copy folder

Copy the directory path1 to path2, with all its contents

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)

New implementation...
< >
programming-idioms.org