From 7cbbe325e435eb06019576497b852ab0bf774bfd Mon Sep 17 00:00:00 2001 From: Andrew Christianson Date: Thu, 11 Dec 2014 11:29:20 -0800 Subject: [PATCH] split inpit paths on '://' instead of ':' s.t. absolute windows paths work --- .gitignore | 1 + src/drake/fs.clj | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9b9908e..777a37e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ pom.xml .classpath .project drake.log +.nrepl* diff --git a/src/drake/fs.clj b/src/drake/fs.clj index 2377ba6..685bc16 100644 --- a/src/drake/fs.clj +++ b/src/drake/fs.clj @@ -19,15 +19,15 @@ (defn split-path "Returns a tuple: prefix (possibly empty) and path." [path] - (let [splt (split path #":" -1)] + (let [splt (split path #"://" -1)] (if (= (count splt) 1) ["file" (first splt)] - [(first splt) (join ":" (rest splt))]))) + [(first splt) (join "://" (rest splt))]))) (defn make-path "The reverse of split-path" [prefix path] - (str prefix (when (seq prefix) ":") path)) + (str prefix (when (seq prefix) "://") path)) (defn path-fs "Returns path's filesystem prefix (or an empty string if not specified)." @@ -464,4 +464,4 @@ (defn newest-in [path] - (pick-by-mod-time path -)) \ No newline at end of file + (pick-by-mod-time path -))