Overiding the default preferences directory in Racket applications

20 views
Skip to first unread message

Alex Harsanyi

unread,
Jul 25, 2020, 5:02:09 AM7/25/20
to Racket Users

If a Racket package uses `get-preference` and `(find-system-path 'pref-dir)`
to store some data, is there a way for an application using that package to
override the default preferences file used and the preferences directory
returned by `(find-system-path 'pref-dir)`?

The reason I ask this question is that my map-widget package uses
"(find-system-path 'pref-dir)" to determine the location used to store the
cache for the downloaded map tiles and also uses `get-preference` to retrieve
some parameters regarding map rendering.

This approach works fine when a user installs the package and uses it directly
within Racket, however, when the package is used as part of an application
(and especially when building a standalone distribution of the application), I
would like to be able to override what `(find-system-path 'pref-dir)` returns,
as by default it points to a "racket" path (e.g. %APPDATA%/Racket on windows
and ~/.racket on Linux)

Thanks,
Alex.
Reply all
Reply to author
Forward
0 new messages