@joelanman Do other programming languages/stdlibs offer this? I've seen the equivalent of mkdir -p in many (including Node), but not with a file on the end.
@joelanman@joelanman I thought that was the point of recursive? Not only to make the parent dirs, but also to not complain if some part of the path already exists. Which is a terrible API decision if true, and a crappy omission if I'm wrong.
Note that if the error can't be avoided, let it be thrown and then catch it. Don't check for the directory's existance first, and then try to create it if it wasn't found, which introduces the potential for a race condition.
Add comment