summaryrefslogtreecommitdiff
path: root/src/file.lisp
diff options
context:
space:
mode:
authorckonstanski <carlos.konstanski@olo.com>2021-05-30 21:49:24 -0600
committerckonstanski <carlos.konstanski@olo.com>2021-05-30 21:49:24 -0600
commit26523dcfd30586636a1f21a1b592b6be8c8099e2 (patch)
treea49eb1af86ced84536bf5355bf784d275b41215d /src/file.lisp
parent7f7f364f0a3cf3da7dd50c7f134169530752bf51 (diff)
dependency on org-ckons-condition
Diffstat (limited to 'src/file.lisp')
-rw-r--r--src/file.lisp19
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)