Listing files in a directory in Clojure

后端 未结 7 928
被撕碎了的回忆
被撕碎了的回忆 2020-12-13 17:14

How can I create a list out of all of the files in a specific directory in Clojure? Do I have to resort to calling Java or can Clojure handle this natively?

7条回答
  •  时光取名叫无心
    2020-12-13 17:25

    Also check out the fs library.

    It may not be worth pulling in the extra dependency if you just need a list of files in a directory, but there are many useful utility functions there, for example for:

    • Creating directory structures
    • Copying, deleting, moving
    • Checking and changing permissions
    • Splitting and normalizing paths
    • Creating temporary files and directories
    • Globbing
    • Working with zip and tar files

提交回复
热议问题