# Mac – How to get emacs to insert text into an arbitrary file

elispemacs

I'm trying to create a function that inserts text into an arbitrary file without switching to that file's buffer.

I know this could be done with echo, but is there a way to do it using only elisp?

(defun append-string-to-file (string filename)