简体   繁体   中英

Replicate a directory file structure with empty files

I have a directory with this structure (real use case: thousands of files, 400GB directory!):

mydir/
|---- blabla.mp4         3.2 GB
|---- foo/
       |----- blup/
       |----- test.wav   245 MB
       |----- test.txt   12 KB
|---- xyz/
       |----- test2.txt  10 KB
|---- zzz.wav            100 MB

How to replicate the tree structure + filename structure and get this, with Windows?

mydir_structure/
|---- blabla.mp4         0.0 KB
|---- foo/
       |----- blup/
       |----- test.wav   0.0 KB
       |----- test.txt   0.0 KB
|---- xyz/
       |----- test2.txt  0.0 KB
|---- zzz.wav            0.0 KB

From windows vista, robocopy is included in the OS (for previous versions there is a download from Microsoft)

robocopy \mydir \mydir_structure /create /e

/e indicates a recursive copy including empty folders.

/create creates the empty files in the target hierarchy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM