summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)))