copy_dir: Copy a Folder

Description Usage Arguments See Also Examples

View source: R/dir_mgmt.R

Description

Copy a Folder

Usage

1
copy_dir(path_to_dir, destination_path)

Arguments

path_to_dir

path to the folder to copy

destination_path

path copied to. If the path does not exist, it will be created using 'dir.create_path()'.

See Also

Other directory management functions: dir.create_path(), remove.dir()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Create a Directory Path
dir.create_path("~/Desktop/test")
dir.create_path("~/Desktop/test2")
dir.create_path("~/Desktop/test2/test3")
dir.create_path("~/Desktop/test2/test3/test4/test5")


# Remove Directory
remove.dir("~/Desktop/test2/test3/test4/test5")
remove.dir("~/Desktop/test2/test3/test4")
remove.dir("~/Desktop/test2/test3")
remove.dir("~/Desktop/test2")
remove.dir("~/Desktop/test")


# Copy Folder
dir.create_path("~/Desktop/test2")
dir.create_path("~/Desktop/test2/test3")
dir.create_path("~/Desktop/test2/test3/test4/test5")

copy_dir(path_to_dir = "~/Desktop/test2",
         destination_path = "~/Desktop/test6")

patelm9/cave documentation built on March 29, 2021, 6:28 p.m.