What I'm looking for is this kind of command line interaction at the Windows command line:
C:\temp1>clj some_script.clj
C:\temp2>
Where some_script.clj contains something like:
(cd "c:\\temp2")
So the question is - how do I implement the function cd? Have experimented with clojure.java.shell, but it does not look like the lib I need. This might be a simple question, the problem might be that I'm not fluent in Java?!
The cd command, also known as chdir (change directory), is a command-line shell command used to change the current working directory in various operating systems. It can be used in shell scripts and batch files.
Open the Command prompt, type in cd followed by the directory you want to move into, and hit Enter. Change the Windows directory by entering the drive name followed by : in the Command prompt, and hit Enter. In the Command prompt, type cd and drag the folder you want to move into from the GUI.
Create a new Clojure project with Leiningen. Build the project to create an executable JAR file. Execute the JAR file. Execute code in a Clojure REPL.
os. Chdir() is used to change the current working directory to the named directory in golang. It is similar to the cd command.
You can't do this in Java, so you can't do it in Clojure. See Changing the current working directory in Java?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With