Re: os-working-directory Lassi Kortela 30 Apr 2020 06:12 UTC

> (current-directory [new-directory])    →    string       (procedure)
>    POSIX getcwd(), chdir()
>
> An R7RS or SRFI 39 parameter representing the current (working)
> directory. If it is invoked with no arguments, it returns the current
> directory as a string. If called with a single string argument, it sets
> the current directory to the new value. If referenced by a parameterize
> expression, the current directory is set to the new value, and (unless
> the operating system prevents it) restored at the end of parameterize.
> the user's home directory.
>
> Note that in POSIX the working directory is per-process rather than
> per-thread. However, a Scheme implementation which natively provides a
> per-thread working directory should also provide per-thread semantics
> for this procedure.

We should probably change that to "MUST provide per-thread semantics".
If that's optional, won't it hamper the portability of multi-threaded
Scheme programs if they can't trust how the current directory is
handled? In fact, if some multi-threaded Schemes have a per-thread WD
and others don't, how will people write portable thread code changing
the current directory?

> I'll do something similar for
> umask.  I have also added an argument to `make-process` and `fork` in
> the pre-SRFI
> <https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/ProcessesCowan.md>
> which will set the values on the child side.

+1