In Clojure 1.3, How to read and write a file

后端 未结 6 493
夕颜
夕颜 2020-12-07 06:48

I\'d like to know the \"recommended\" way of reading and writing a file in clojure 1.3 .

  1. How to read the whole file
  2. How to read a file line by line
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 07:28

    (require '[clojure.java.io :as io])
    (io/copy (io/file "/etc/passwd") \*out*\)
    

提交回复
热议问题