On 8/24/20, Thomas Del Vecchio <thomas_del_vecc...@brown.edu> wrote:
> Hi everyone!
>
> I'm currently working on some usage logging for a language we're
> developing. We need to store a persistent file that is shared across a
> given device (so that the same log file is used regardless of where you are
>
> working). Is there a best place to put this file? I'm looking at
> find-system-path
> <https://docs.racket-lang.org/reference/Filesystem.html#%28def._%28%28quote._~23~25kernel%29._find-system-path%29%29>,
>
> but am not sure from the documentation if one of these is best for this
> purpose.
>
> One option I'm considering is in `(collection-file-path (build-path
> "logging" "user-logs.log") "<my-language>")`, which is just
> "<path>/<to>/<my-language>/logging/user-logs.log", but I'm unsure whether
> it's safe to store user data there (especially if we are expecting to have
> package updates).
>
> Thanks so much!
> Thomas

Try the `basedir` package. You can ask for a `(writeable-data-file
"user-logs.log" #:program "<my-language>")`.

https://docs.racket-lang.org/basedir/index.html

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAFUu9R6aX9ijNkUOa-Rq5C4xer4MkiqUycN2veNtx%3DPzduaANQ%40mail.gmail.com.

Reply via email to