Manipulating files and directories
In this recipe, we will show you how to read from files and write to files. Then we will learn how to create, delete, and list files and directories.
Getting ready
This recipe does not make use of any external library, so you can just start a REPL and be ready. As we manipulate files and directories, be careful to not delete files or directories and not overwriting the contents of your important files through inattention. We will make use of the source code of Clojure on the GitHub, so you need to install the git
client to obtain the source.
How to do it...
Let's learn how to read and write files. We will also learn how to create and delete files and directories. Then we will see how to list files and directories. ...
Get Clojure Programming Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.