Skip to content

Latest commit

 

History

History
5 lines (3 loc) · 1.46 KB

14.md

File metadata and controls

5 lines (3 loc) · 1.46 KB

Day 17

Today I worked more on the journal writing program I created the other day. I attempted to make it so you don't have to write the location to save the journal to every time you run the app. The first time you write it the path, it would save it to a file. Then every time the program is used from then on it would just load whatever was in the file in to the program. I got the basic logic down of course, and it does indeed save the file path you enter to a text file. However, when it runs the next time and recognizes that there's a file and then tries to save the journal entry to the appropriate path, I get a weird error: error opening #P"/path/to/journals/journal.txt": No such file or directory. Apparently #P is denoting that the following string is a file path. Which is true. But what's not true is the file not existing. I opened up Finder to verify and there indeed was a file. Plus it didn't fun the part of the if form associated with the file not existing. So I'm not completely sure what I'm doing wrong, but that's for tomorrow or another day.

EDIT: Duh. It's trying to find the journal file in the current directory. However, now I'm using the library uiop for reading in text from a file in the hopes that this would allow me to just concatenate the file name with the path but instead it's concatenating the current directory's path with the text being read in from the file and then with the file name. This is very hairy. I'll work more on this tomorrow.