notes app: ensure file exists
This commit is contained in:
parent
34d36d56ba
commit
22ea488666
1 changed files with 2 additions and 3 deletions
|
|
@ -12,10 +12,9 @@
|
||||||
|
|
||||||
(def notes-file (io/file (System/getProperty "user.home") ".notes" "notes.txt"))
|
(def notes-file (io/file (System/getProperty "user.home") ".notes" "notes.txt"))
|
||||||
(io/make-parents notes-file)
|
(io/make-parents notes-file)
|
||||||
|
;; ensure file exists
|
||||||
|
(.createNewFile notes-file)
|
||||||
(def file-lock (Object.))
|
(def file-lock (Object.))
|
||||||
;; ensure notes file exists
|
|
||||||
(spit notes-file "" :append true)
|
|
||||||
|
|
||||||
(defn write-note! [note]
|
(defn write-note! [note]
|
||||||
(locking file-lock
|
(locking file-lock
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue