Re: ensure-directories aka create-directories
Lassi Kortela 31 Jul 2020 12:32 UTC
> My perception is that srfi-170 corresponds to POSIX.1 (excluding some
> subdomains that are to be other srfis). "mkdir -p" is not POSIX.1; it
> is POSIX.2.
Are these POSIX.n numbers explained somewhere, and do they have listings
of what was added to each standard?
> It won't be expensive itself, but if we start including such utilities
> above POSIX.1 layer, I'm afraid that the boundary of what to include
> gets blurred. For example, if we have "mkdir -p", then why not "rm -r" ?
True. Python has a shutil module for the kind of thing.
<https://docs.python.org/3/library/shutil.html>
Though they put makedirs() in the os module
<https://docs.python.org/3/library/os.html#os.makedirs>.
I suggest we do the same. makedirs() is so often needed that people keep
writing lots of subtly incorrect implementations of it.