templates / branches--on commit avoid "write_in_full(fd, buf, len) != len" pattern (06f46f2)
   1: this is just to ensure the directory exists.