Pick the next YYYY-MM-DD-N directory and create it, so no other render
can pick the same one.
nextOutputDir only computes a name; creating it used to wait for
writeRun, after a multi-second render loop. Two renders started together
(a double-clicked Render, or two posts at once) both picked the same N, and
both wrote their slides into one directory: last write won per file, and a
post's export could show another post's images. A non-recursive mkdir is
the reservation: it fails with EEXIST if anyone, in this process or
another, got there first, and then the next number is tried.
Pick the next
YYYY-MM-DD-Ndirectory and create it, so no other render can pick the same one.nextOutputDironly computes a name; creating it used to wait forwriteRun, after a multi-second render loop. Two renders started together (a double-clicked Render, or two posts at once) both picked the sameN, and both wrote their slides into one directory: last write won per file, and a post's export could show another post's images. A non-recursivemkdiris the reservation: it fails withEEXISTif anyone, in this process or another, got there first, and then the next number is tried.