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

16 lines
453 B
Plaintext
Raw Normal View History

2017-07-16 09:04:35 +00:00
(ns status-im.utils.fs
(:require [status-im.react-native.js-dependencies :as rn-dependencies]))
(defn move-file [src dst handler]
2017-07-16 09:04:35 +00:00
(-> (.moveFile rn-dependencies/fs src dst)
2017-05-18 22:19:46 +00:00
(.then #(handler nil %))
(.catch #(handler % nil))))
(defn read-file [path encoding on-read on-error]
2017-07-16 09:04:35 +00:00
(-> (.readFile rn-dependencies/fs path encoding)
(.then on-read)
(.catch on-error)))
(defn read-dir [path]
(.readDir rn-dependencies/fs path))