src/commands/rm.js
function isWriteable(file) {
  let writePermission = true;
  try {
    const __fd = fs.openSync(file, 'a');
    fs.closeSync(__fd);
  } catch (e) {
    /* istanbul ignore next */
    writePermission = false;
  }

  return writePermission;
}
function isWriteable(file) {
  let writePermission = true;
  try {
    const __fd = fs.openSync(file, 'a');
    fs.closeSync(__fd);
  } catch (e) {
    /* istanbul ignore next */
    writePermission = false;
  }

  return writePermission;
}
function isWriteable ( file ) { let writePermission = true ; try { const __fd = fs . openSync ( file , 'a' ) ; fs . closeSync ( __fd ) ; } catch ( e ) { /* istanbul ignore next */ writePermission = false ; } return writePermission ; }
Hack to determine if file has write permissions for current user Avoids having to check user, group, etc, but it's probably slow.
Hack to determine if file has write permissions for current user Avoids having to check user group etc but it s probably slow .