status-react/src/status_im/utils/fs.cljs

23 lines
516 B
Plaintext
Raw Normal View History

2017-07-16 09:04:35 +00:00
(ns status-im.utils.fs
(:require ["react-native-fs" :as react-native-fs]))
(defn move-file [src dst]
(.moveFile react-native-fs src dst))
(defn read-file [path encoding on-read on-error]
(-> (.readFile react-native-fs path encoding)
(.then on-read)
(.catch on-error)))
(defn read-dir [path]
(.readDir react-native-fs path))
(defn mkdir [path]
(.mkdir react-native-fs path))
(defn unlink [path]
(.unlink react-native-fs path))
(defn file-exists? [path]
(.exists react-native-fs path))