diff options
Diffstat (limited to 'src/file.lisp')
| -rw-r--r-- | src/file.lisp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/file.lisp b/src/file.lisp index ab8c76a..177d375 100644 --- a/src/file.lisp +++ b/src/file.lisp @@ -4,7 +4,7 @@ (defpackage :org-ckons-file (:use :cl)) -(in-package #:org-ckons-file) +(in-package :org-ckons-file) (defun compile-and-load (filename) "Compiles and then loads a file. `filename' should not have an @@ -57,21 +57,6 @@ line at a time." (defun mkdir (path) (org-ckons-core::shell-wrapper (format nil "mkdir -p ~a" path))) -(defun copy-file (source destination) - "Copies file from `source' to `destination'. If the destination -directory does not exist, it will be created." - (when (and (file-exists-p source) - (file-p source) - (not (org-ckons-core::null-or-empty-p destination))) - (let ((destination-parts (nreverse (remove-if #'org-ckons-core::null-or-empty-p (ppcre:split "/" destination)))) - (destination-file "") - (destination-directory "")) - (setf destination-file (pop destination-parts)) - (loop for part in (nreverse destination-parts) do - (setf destination-directory (format nil "~a/~a" destination-directory part))) - (mkdir destination-directory) - (org-ckons-core::shell-wrapper (format nil "cp '~a' '~a'" source destination))))) - (defun purge-old-files (directory-path) "Deletes everything out of a directory that is older than 8 hours old." @@ -88,7 +73,7 @@ old." (defun file-mtime (file-path) (let ((output (car (org-ckons-core::shell-wrapper (format nil "ls --full-time '~a' |awk '{ print $6,$7 }' |awk -F. '{ print $1; }'" file-path))))) (if (not (org-ckons-core::match-it "^\\d\\d\\d\\d-\\d\\d-\\d\\d \\d\\d:\\d\\d:\\d\\d$" output)) - (error 'handled-error :text (format nil "Error in `file-mtime': ~a" output)) + (error 'org-ckons-condition::handled-error :text (format nil "Error in `file-mtime': ~a" output)) output))) (defun directory-p (absolute-path) |
