【问题标题】:Most efficent way to move a directory in haskell [closed]在haskell中移动目录的最有效方法[关闭]
【发布时间】:2014-12-05 02:53:42
【问题描述】:

移动目录及其所有内容的最有效方法是什么?

有没有比循环目录中的每个文件并在其上调用System.Directory.renameFile 更有效的方法?

【问题讨论】:

  • 投票重开,因为问题已从“最佳”改写为可量化的,即“高效”。

标签: file haskell io


【解决方案1】:

只需使用System.Directory.renameDirectory

λ System.Directory.getDirectoryContents "temp2"
[".","..","x","y"]
λ System.Directory.renameDirectory "temp2" "temp"
λ System.Directory.getDirectoryContents "temp"
[".","..","x","y"]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-18
    • 2012-09-02
    • 1970-01-01
    • 2010-09-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多