summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorckonstanski <carlos.konstanski@olo.com>2021-06-26 14:26:15 -0600
committerckonstanski <carlos.konstanski@olo.com>2021-06-26 14:26:15 -0600
commit4e8b2306e783417047b97f0c6fdf8f080f90d20d (patch)
tree150a77dbf4d0573c5527652a3c02f4cb59c2a03a /src
parent26523dcfd30586636a1f21a1b592b6be8c8099e2 (diff)
Function to support email attachments
Diffstat (limited to 'src')
-rw-r--r--src/file.lisp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/file.lisp b/src/file.lisp
index 177d375..7dfe480 100644
--- a/src/file.lisp
+++ b/src/file.lisp
@@ -54,6 +54,15 @@ line at a time."
(loop for ,line = (read-line ,stream nil nil)
while ,line do ,@body))))
+(defun read-whole-file (filename)
+ (with-open-file (stream filename)
+ (let ((contents (make-string (file-length stream))))
+ (read-sequence contents stream)
+ contents)))
+
+(defun get-mime-type (filename)
+ (car (org-ckons-core::shell-wrapper (format nil "file --mime-type ~a | awk -F': ' '{print $2}'" filename))))
+
(defun mkdir (path)
(org-ckons-core::shell-wrapper (format nil "mkdir -p ~a" path)))