Raynes / fs

File system utilities for Clojure.
453 stars 119 forks source link

Return a string rather than a file from parent. #78

Closed rosejn closed 10 years ago

rosejn commented 10 years ago

The parent method was returning a file object rather than a string path, which meant to get the directory of a file you had to do something like (.getPath (parent "path/to/my/file.txt")).

Raynes commented 10 years ago

This is intentional. fs functions purposely return File objects whenever possible because usually that's what you actually want. It prevents unnecessary string -> File conversions when chaining functions as well.

You can also do (str (parent "path/to/file.txt")).

rosejn commented 10 years ago

Ah, ok. I didn't realize you could use str on a file object to get the plain path. Thanks.