Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Common Lisp: creating a directory

Is there a way to create a directory using common lisp. I want to first create a folder and then put my .txt .png files in that. I know that first I can create the folder externally and then using with-open-file and so on create my files inside the directory. What I want is a common lisp solution for this.

like image 750
jkt Avatar asked Feb 27 '12 19:02

jkt


People also ask

How do you create a new directory?

Create a New Directory ( mkdir ) The first step in creating a new directory is to navigate to the directory that you would like to be the parent directory to this new directory using cd . Then, use the command mkdir followed by the name you would like to give the new directory (e.g. mkdir directory-name ).

What does the walk function do in C?

The walk functions are useful for performing actions like writing files and printing plots. For example, say we used purrr to generate a list of plots. We can now use walk() to print them out.

How do I upload a file to a lisp?

The solution is to use the load function. w You can either type directly into the file, or else copy and paste. w Lisp will read everything in each of the files just as if it were being typed into the top level Lisp interpreter.

How do I open a LISP file?

Opening Files You can use the open function to create a new file or to open an existing file. It is the most basic function for opening a file.


2 Answers

(ensure-directories-exist "/path/name/")
like image 162
trutheality Avatar answered Oct 14 '22 14:10

trutheality


This page seems to be a nice writeup, explaining all the nuances of the file I/O issue that CL needs to address.

like image 39
Greg Avatar answered Oct 14 '22 16:10

Greg