Reputation: 24760
I am new to Common Lisp and am trying to conceive of the best way to generate a large text file. I see basically two options:
Perhaps similar to 1 would be: 3. Create a string output stream and write to that, then write this stream to a new file stream.
The problem with 1 & 3 is that I don't think strings are designed to hold very large text contents, are they?
The problem with 2 is that it seems wasteful to constantly open and close a file, even if doing so conveniently with a with-
command; seems inefficient and potentially error prone.
What is the typical way this is done?
Upvotes: 1
Views: 150
Reputation: 528
Open the file stream and just keep it open for all your work, then close it and move onto another stream if necessary. No need to constantly reopen and close the file.
Upvotes: 1