Re: Per-process vs per-thread current-directory once more
Lassi Kortela 03 Aug 2020 08:25 UTC
> (parameterize ((current-directory #f))
> (readlink "foo/bar"))
>
> to temporarily disable the per-thread current-directory for SRFI 170
> procedures and use the OS current-directory.
Wait, #f works in neither Gambit nor Kawa since they type-check the
parameter. It needs to be a string. (Kawa has path objects so it can
also be a path, and a string is turned into a path. The Kawa parameter
is called `current-path`.)
We could have:
(parameterize ((current-directory (use-os-current-directory)))
(read-symlink "foo/bar"))
where (use-os-current-directory) returns an implementation-defined
object that skips the per-thread current-directory.
Apparently it also works as expected to make an alias for a parameter:
(define current-directory current-path)