Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Clojure to create symlink

I've been focusing on Clojure recently as a possible functional language to do systems scripting. Until, it dawned on me that having the JVM underneath means I'm limited to Java's capability.

So, how do I create a symlink? Or a hard link? I mean without (sh "ln" ...).

like image 231
qrest Avatar asked Oct 14 '22 01:10

qrest


1 Answers

Ah, this is indeed a pain. I'm not sure the sh option is all that bad, actually... Having said that, Ant provides a symlink task which you could use in a reasonably Clojure-friendly way through Lancet, the Ant wrapper originally introduced by Stuart Halloway in his "Programming Clojure" book and currently used internally by Leiningen. If you want to see the symlink task in action in Leiningen, have a look at this line in the 1.3.0 release.

like image 144
Michał Marczyk Avatar answered Oct 20 '22 18:10

Michał Marczyk