The idiomatic way may be to include the file(s) in the classpath and
there is already a `resource` function in clojure.java.io that can
load it from the classpath:
$ lein new foo
$ cd foo
$ mkdir resources
$ catresources/test.txt
hello
world
foo
bar
^D
$ # edit src/foo/core.clj as follows
(ns
Hi,
I'd like to bundle a collection of (JSON) datafiles with a Clojure
project source tree so that Clojure functions can reliably find and
open those datafiles.
What's the idiomatic way of going about this? In the past with other
languages I've used tricks like Ruby's .dirname(__FILE__)/...
Hey,
I don't have a good example, but the right way to do is with resources
which are basically just files that live on the classpath:
* Put the files in a folder on your classpath. If your using
leiningen, the resources/ directory does this by default.
* Get a URL to the file with
I'd like to bundle a collection of (JSON) datafiles with a Clojure
project source tree so that Clojure functions can reliably find and
open those datafiles.
What's the idiomatic way of going about this?
One idiomatic way to do this in Clojure is:
- store the files within a directory
On Jun 29, 12:17 pm, Stephen C. Gilardi squee...@mac.com wrote:
I'd like to bundle a collection of (JSON) datafiles with a Clojure
project source tree so that Clojure functions can reliably find and
open those datafiles.
What's the idiomatic way of going about this?
Many thanks to