Add support for BasicFileAttributes
This commit is contained in:
parent
aaaab5f6eb
commit
948c38c035
2 changed files with 12 additions and 2 deletions
|
|
@ -243,6 +243,7 @@
|
||||||
java.nio.file.PathMatcher
|
java.nio.file.PathMatcher
|
||||||
java.nio.file.Paths
|
java.nio.file.Paths
|
||||||
java.nio.file.StandardCopyOption
|
java.nio.file.StandardCopyOption
|
||||||
|
java.nio.file.attribute.BasicFileAttributes
|
||||||
java.nio.file.attribute.FileAttribute
|
java.nio.file.attribute.FileAttribute
|
||||||
java.nio.file.attribute.FileTime
|
java.nio.file.attribute.FileTime
|
||||||
java.nio.file.attribute.PosixFilePermission
|
java.nio.file.attribute.PosixFilePermission
|
||||||
|
|
@ -463,7 +464,10 @@
|
||||||
(first (t/getInterfaces v))
|
(first (t/getInterfaces v))
|
||||||
;; fix for #1061
|
;; fix for #1061
|
||||||
(instance? java.io.Closeable v)
|
(instance? java.io.Closeable v)
|
||||||
java.io.Closeable)))))
|
java.io.Closeable
|
||||||
|
(instance? java.nio.file.attribute.BasicFileAttributes v)
|
||||||
|
java.nio.file.attribute.BasicFileAttributes
|
||||||
|
,,,)))))
|
||||||
|
|
||||||
(def class-map (gen-class-map))
|
(def class-map (gen-class-map))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -412,7 +412,13 @@
|
||||||
(let [v (bb nil "-f" (.getPath (io/file "test-resources" "babashka" "glob.clj")))]
|
(let [v (bb nil "-f" (.getPath (io/file "test-resources" "babashka" "glob.clj")))]
|
||||||
(is (vector? v))
|
(is (vector? v))
|
||||||
(is (.exists (io/file (first v)))))
|
(is (.exists (io/file (first v)))))
|
||||||
(is (= :success (bb nil "(with-open [str (java.nio.file.Files/newDirectoryStream (.toPath (clojure.java.io/file \".\")))] :success)")))))
|
(is (= :success (bb nil "(with-open [str (java.nio.file.Files/newDirectoryStream (.toPath (clojure.java.io/file \".\")))] :success)")))
|
||||||
|
(is (string? (bb nil
|
||||||
|
'(do (import [java.nio.file Files LinkOption])
|
||||||
|
(import [java.nio.file.attribute BasicFileAttributes])
|
||||||
|
(def attrs (Files/readAttributes (.toPath (io/file ".")) BasicFileAttributes ^"[Ljava.nio.file.LinkOption;"
|
||||||
|
(into-array LinkOption [])))
|
||||||
|
(str (.lastModifiedTime attrs))))))))
|
||||||
|
|
||||||
(deftest future-print-test
|
(deftest future-print-test
|
||||||
(testing "the root binding of sci/*out*"
|
(testing "the root binding of sci/*out*"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue