1

enter image description here

this method can't satisfy entirely me because that it's recursive. I just need to list files and directory of current path.

like this... the example can't print it as follows.

enter image description here

thanks!

Tornado
  • 115
  • 1
  • 7
  • In the future, try to copy and past text into code blocks (use `Ctrl + K` to indent the code block). This makes it more easily searchable in Google. – DonyorM Oct 12 '16 at 16:37

1 Answers1

6

You can use .list to get the directory listing for a given path like so.

user=> (require '[clojure.java.io :as io])
nil
user=> (map pprint (.list (io/file "./")))
".android"
".AndroidStudio2.0"
".ansible"
".anyconnect"
uhjish
  • 104
  • 1
  • 2