ensure-directories aka create-directories Lassi Kortela (31 Jul 2020 10:47 UTC)
(missing)
(missing)
Re: ensure-directories aka create-directories Lassi Kortela (31 Jul 2020 12:32 UTC)
Re: ensure-directories aka create-directories John Cowan (31 Jul 2020 13:03 UTC)
Re: ensure-directories aka create-directories John Cowan (31 Jul 2020 13:10 UTC)
Re: ensure-directories aka create-directories Lassi Kortela (31 Jul 2020 13:14 UTC)
Re: ensure-directories aka create-directories John Cowan (31 Jul 2020 13:19 UTC)
Re: ensure-directories aka create-directories Lassi Kortela (31 Jul 2020 13:31 UTC)
Re: ensure-directories aka create-directories Shiro Kawai (31 Jul 2020 18:03 UTC)
Re: ensure-directories aka create-directories Lassi Kortela (02 Aug 2020 10:20 UTC)
Re: ensure-directories aka create-directories Lassi Kortela (31 Jul 2020 12:10 UTC)

Re: ensure-directories aka create-directories Lassi Kortela 31 Jul 2020 12:10 UTC

> This is mkdir(1) with the -p argument, officially a POSIX standard:
>
> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/mkdir.html

Yes, basically the same thing.

> And I agree, it's a really useful thing.  It would not be super
> expensive to add to srfi-170.html, and the Chibi Scheme sample
> implementation.  The former has undergone enough changes (two APIs
> dropped) that I assume another draft will need to be published.

When people write their own ad hoc implementation of it, the following
are easy to get wrong:

- handling the situation where the given path (or its parents) exist but
are not directories.

- splitting the pathname correctly when looping through pathname
components to create the parents.

- giving into the temptation to use the shortcut:
     (unless (exists? ...) (create ...))
   instead of doing it right:
     (guard (create ...) (... (if EEXIST-or-EISDIR  ...))

We could consolidate all additions/changes to the next draft.