From 22ea4886667c4a7fe44e5d7483531075fcec9c4d Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Sun, 29 Mar 2020 14:10:53 +0200 Subject: [PATCH] notes app: ensure file exists --- examples/notes.clj | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/notes.clj b/examples/notes.clj index db24141d..fa126e2d 100755 --- a/examples/notes.clj +++ b/examples/notes.clj @@ -12,10 +12,9 @@ (def notes-file (io/file (System/getProperty "user.home") ".notes" "notes.txt")) (io/make-parents notes-file) - +;; ensure file exists +(.createNewFile notes-file) (def file-lock (Object.)) -;; ensure notes file exists -(spit notes-file "" :append true) (defn write-note! [note] (locking file-lock