(with-open-file (str "/.../filename.txt" :direction :output :if-exists :supersede :if-does-not-exist :create) (format str "write anything ~%"))
You can also select various settings for the with-open-file
macro. If you use :append
instead of :supersede
, then you can write to a text file while maintaining its context instead of replacing the available content.
source share