Re: Normalizing the current directory
Marc Feeley 23 Apr 2020 11:55 UTC
> On Apr 23, 2020, at 7:38 AM, Lassi Kortela <xxxxxx@lassi.io> wrote:
>
>> Gambit does what you suggest and also normalizes the path:
>>> (current-directory "/tmp")
>>> (current-directory)
>> "/private/tmp/"
>
> Is the normalization done using realpath()? I wonder whether there are edge cases where that causes problems.
No Gambit does not use realpath() because it is more portable in my experience to use the pattern:
chdir(dir);
getcwd(normalized_dir, len);
with a lock around that to avoid interference with other OS threads when configured with --enable-multiple-threaded-vms .
Maybe lib/os_files.c should be extended to allow using realpath() if it is available.
Marc