Email list hosting service & mailing list manager

Re: SRFI 170: 270 days John Cowan (06 Feb 2020 03:52 UTC)
Re: SRFI 170: 270 days Arthur A. Gleckler (06 Feb 2020 05:51 UTC)
CWD and other unresolved issues Lassi Kortela (07 Feb 2020 15:34 UTC)
Re: CWD and other unresolved issues John Cowan (07 Feb 2020 15:42 UTC)
Re: CWD and other unresolved issues Lassi Kortela (07 Feb 2020 15:47 UTC)
Re: CWD and other unresolved issues John Cowan (07 Feb 2020 18:04 UTC)
Re: CWD and other unresolved issues Arthur A. Gleckler (07 Feb 2020 18:48 UTC)
Re: CWD and other unresolved issues Per Bothner (07 Feb 2020 18:57 UTC)
(missing)
Re: CWD and other unresolved issues Per Bothner (08 Feb 2020 07:33 UTC)
Pathnames and URIs Lassi Kortela (08 Feb 2020 09:12 UTC)
Re: Pathnames and URIs Lassi Kortela (08 Feb 2020 09:20 UTC)
Re: CWD and other unresolved issues John Cowan (08 Feb 2020 18:58 UTC)
Pathname representations Lassi Kortela (07 Feb 2020 22:19 UTC)
Re: Pathname representations Per Bothner (07 Feb 2020 22:32 UTC)
Re: Pathname representations Arthur A. Gleckler (07 Feb 2020 22:36 UTC)
Re: Pathname representations Lassi Kortela (07 Feb 2020 22:50 UTC)
Re: Pathname representations John Cowan (08 Feb 2020 07:02 UTC)
Re: CWD and other unresolved issues John Cowan (07 Feb 2020 19:01 UTC)
Re: CWD and other unresolved issues Arthur A. Gleckler (07 Feb 2020 19:20 UTC)
Re: CWD and other unresolved issues Marc Feeley (07 Feb 2020 20:15 UTC)

Re: CWD and other unresolved issues Lassi Kortela 07 Feb 2020 15:47 UTC

>     We discussed adding 170 to Gambit with Marc, and he again made the case
>     that requiring the Scheme CWD to be equal to the OS CWD is not
>     practical for multi-threaded programs.
>
> I don't understand the reasoning behind this.  Posix describes chdir()
> as per-process, so changing it will affect all threads.

Here are the arguments from <https://github.com/udem-dlteam/libs/issues/13>:

> chdir and OS threads are simply incompatible (because the CWD is a per process thing so shared by all OS threads). So defining filesystem access procedures that are sensitive to the per process CWD makes it impossible to use those procedures effectively in a multithreaded Scheme system. That's why Gambit uses a distinct current-directory parameter object that can have a per Scheme thread binding and relative paths are interpreted relative to the Scheme thread's current-directory.
>
> The fundamental question is "what is SRFI 170 trying to achieve"? If the answer is "an interface to posix functions such as chdir, open, etc" then that is fine, but it shouldn't presume that there is a link between the posix open and the Scheme open-input-file, the posix relative paths and the Scheme relative paths, etc
>
> Anyway, in Gambit there is (path-normalize path) that can be called to turn the (possibly relative) path into an absolute path (using the current-directory parameter object if the path is relative), and the absolute path can be passed to the posix open in order to avoid being dependent on the process CWD.

Having a per-process CWD will of course work, strictly speaking, but
each thread may in principle change the CWD from underneath other
threads at any time.