• (file arg)
  • (file parent child)
  • (file parent child & more)
Returns a java.io.File, passing each arg to as-file. Multiple-arg
versions treat the first argument as parent and subsequent args as
children relative to the parent.

1 Example top

  • user> (clojure.java.io/file "/tmp/foo")
    #<File /tmp/foo>
    
    user> (clojure.java.io/file "http://asdf.com")
    #<File http:/asdf.com>
    
    user> (clojure.java.io/file "/tmp/foo" "bar")
    #<File /tmp/foo/bar>
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/java/io.clj:395 top

(defn ^File file
  "Returns a java.io.File, passing each arg to as-file.  Multiple-arg
   versions treat the first argument as parent and subsequent args as
   children relative to the parent."
  {:added "1.2"}
  ([arg]                      
     (as-file arg))
  ([parent child]             
     (File. ^File (as-file parent) ^String (as-relative-path child)))
  ([parent child & more]
     (reduce file (file parent child) more)))
Vars in clojure.java.io/file:
Used in 0 other vars

Comments top

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