Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
FileUtils.cp_r完全符合我的需要,但它无法通过某种模式过滤掉文件。
所以,我想递归地将复杂的文件夹/文件结构复制到另一个目录,但我只想包含带有txt扩展名的文件。我该怎么做?
txt
FileUtils.cp_r Dir['**/*.txt'], target_dir