• (file-str & args)
Concatenates args as strings and returns a java.io.File. Replaces
all / and \ with File/separatorChar. Replaces ~ at the start of
the path with the user.home system property.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/io.clj:93 top

(defn ^File file-str
  "Concatenates args as strings and returns a java.io.File.  Replaces
  all / and \\ with File/separatorChar.  Replaces ~ at the start of
  the path with the user.home system property."
  [& args]
  (let [^String s (apply str args)
        s (.replace s \\ File/separatorChar)
        s (.replace s \/ File/separatorChar)
        s (if (.startsWith s "~")
            (str (System/getProperty "user.home")
                 File/separator (subs s 1))
            s)]
    (File. s)))
Vars in clojure.contrib.io/file-str: defn let
Used in 0 other vars

Comments top

No comments for file-str. Log in to add a comment.