docs: function getDirectoryUidIfCannotModify(dir) {
      return new Promise((fulfill, reject) => {
          fs.stat(dir, (err, stats) => {
              if (err) {
                  return reject(err);
              }
              if (!stats.isDirectory()) {
                  return reject(new Error('Not a directory'));
              }
              fs.access(dir, fs.constants.W_OK, err => {
                  if (err) {
                      // user can't write to this directory
                      fulfill(stats.uid);
                      return;
                  }
                  fulfill(null); // user can write to this directory
              });
          })
      });
  }