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

23 lines
567 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]
2019-05-22 05:50:49 +00:00
(.moveFile (rn-dependencies/fs) src dst))
(defn read-file [path encoding on-read on-error]
2019-05-22 05:50:49 +00:00
(-> (.readFile (rn-dependencies/fs) path encoding)
(.then on-read)
(.catch on-error)))
(defn read-dir [path]
2019-05-22 05:50:49 +00:00
(.readDir (rn-dependencies/fs) path))
(defn mkdir [path]
2019-05-22 05:50:49 +00:00
(.mkdir (rn-dependencies/fs) path))
(defn unlink [path]
2019-05-22 05:50:49 +00:00
(.unlink (rn-dependencies/fs) path))
(defn file-exists? [path]
2019-05-22 05:50:49 +00:00
(.exists (rn-dependencies/fs) path))