# Copy folder structure and make new folder?

**URL:** https://discourse.julialang.org/t/copy-folder-structure-and-make-new-folder/50433
**Category:** New to Julia
**Created:** [November 19, 2020, 1:32pm UTC](https://discourse.julialang.org/t/copy-folder-structure-and-make-new-folder/50433 "2020-11-19T13:32:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)
#### Post date: [November 19, 2020, 1:32pm UTC](https://discourse.julialang.org/t/copy-folder-structure-and-make-new-folder/50433/1 "2020-11-19T13:32:10Z")

</div>

Hello!

Suppose I have a folder structure on my harddrive as:

```julia
Main Folder
-- 01_FirstFolder
  --> 1stSubFolder
  --> 2ndSubFolder
  --> 3rdSubFolder
-- 02_SecondFolder
  --> 1stSubFolder
  --> 2ndSubFolder
  --> 3rdSubFolder

```

How would I go about copying the folder structure, to make a new “New Main Folder” with the exact same folder structure inside? Just without any of the previous file content.

Kind regards

---

<div class="post-metadata">

### Author: ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)
#### Post date: [November 19, 2020, 5:27pm UTC](https://discourse.julialang.org/t/copy-folder-structure-and-make-new-folder/50433/2 "2020-11-19T17:27:01Z")

</div>

Directly adapated from the example in the `walkdir` docs (but have not tested!):

```julia
for (root, dirs, files) in walkdir(sourceDir)
     for dir in dirs
          mkpath(joinpath(tgDir, dir))
     end
end

```
