简体   繁体   English

用空文件复制目录文件结构

[英]Replicate a directory file structure with empty files

I have a directory with this structure (real use case: thousands of files, 400GB directory!): 我有一个具有这种结构的目录(实际用例:数千个文件,400GB目录!):

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? 如何使用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) 从Windows Vista中,操作系统中包含了robocopy (对于以前的版本,可以从Microsoft下载)

robocopy \mydir \mydir_structure /create /e

/e indicates a recursive copy including empty folders. /e表示包括空文件夹的递归副本。

/create creates the empty files in the target hierarchy. /create在目标层次结构中创建空文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何删除文件和文件夹但保留目录结构并留下空文件而不是文件本身? - How to delete files and folders but keep directory structure and leave behind a empty file instead of file itself? 如何在 Windows 中使用 xcopy 复制目录结构 - How to replicate a directory structure using xcopy in windows 创建空目录结构 - Create Empty Directory structure 使用具有非常大的目录结构的空间重命名文件 - Rename files with space with very large directory structure 需要将平面目录与路径文件的文本文件列表进行比较,并使用文本文件中的路径结构将其复制到新位置 - Need to compare a flat directory to a text file list of path+files, and copy to new location with path structure from text file 文档中的Subversion目录的文件结构已损坏 - Subversion directory in Documents has corrupted file structure 批处理文件查找目录中的文件 - Batch file to find files in a directory Robocopy-复制文件夹和文件不会重新创建目录结构 - Robocopy - Copying folders and files doesn't recreate directory structure 使用XCopy将具有精确结构的文件复制到另一个目录中 - Copy Files with exact Structure into another Directory using XCopy 如何使用批处理脚本复制文件和文件结构 - How to copy files and file structure with a batch script
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM