https://docs.racket-lang.org/reference/file-ports.html?q=call-with-output-file#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._call-with-output-file%29%29 is there a way to configure these flags such that (call-with-output-file (build-path 'up "test" "test.txt")
does not crash if it tries to write to a directory that does not exist?
By “crash” do you mean “throw an exception”?
yep
I see two options: 1. Use directory-exists?
first. 2. Do as you do now, but use with-handlers
to catch the exception.
ahh k, ill just check if it exists then beforehand
Another option is to always create the directory first whether it exists already by using make-directory*
Of course, it depends on what you want to do. Might not be desirable if you don’t want to create the directory
https://github.com/jeapostrophe/racket-langserver/issues/29 if someone implements this i will love you forever :kissing_heart: . like we should just start funding racket ide tools