Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
5
Task/Truncate-a-file/Clojure/truncate-a-file.clj
Normal file
5
Task/Truncate-a-file/Clojure/truncate-a-file.clj
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
(defn truncate [file size]
|
||||
(with-open [chan (.getChannel (java.io.FileOutputStream. file true))]
|
||||
(.truncate chan size)))
|
||||
|
||||
(truncate "truncate_test.txt" 2)
|
||||
Loading…
Add table
Add a link
Reference in a new issue