 (defn regex? 
   [r]
   (instance? java.util.regex.Pattern r))
+
+(defn- get-absolute-path
+  [path]
+  (reduce 
+    #(case %2
+       :.. (pop %1) 
+       :. %1
+       (conj %1 %2))
+    @CURRENT_DIR path))
 
 (defn- resolve-path
   [parts]

(defn rmdir 
  "Removes a directory"
  [key-name]
  (let [path (resolve-path [key-name])
        v (get-in @FS_ROOT path)]
    (cond 
      (nil? v) 

(defn cd 
  "Changes working directory to new path. Can use :.. as relative location, one up in path."
  [key-path]
  (let [new-path (resolve-single-path key-path)]
    (when-not (keypath-exists? @FS_ROOT new-path) 
      (throw (Exception. (str "Error: Keypath not found: " new-path))))
    (when-not (map? (get-in @FS_ROOT new-path)) 
