function _prepareTmpFileRemoveCallback(name, fd, opts) {
  const removeCallback = _prepareRemoveCallback(function _removeCallback(fdPath) {
    try {
      if (0 <= fdPath[0]) {
        fs.closeSync(fdPath[0]);
      }
    }
    catch (e) {
      // under some node/windows related circumstances, a temporary file
      // may have not be created as expected or the file was already closed
      // by the user, in which case we will simply ignore the error
      if (!isEBADF(e) && !isENOENT(e)) {
        // reraise any unanticipated error
        throw e;
      }
    }
    try {
      fs.unlinkSync(fdPath[1]);
    }
    catch (e) {
      if (!isENOENT(e)) {
        // reraise any unanticipated error
        throw e;
      }
    }
  }, [fd, name]);

  if (!opts.keep) {
    _removeObjects.unshift(removeCallback);
  }

  return removeCallback;
}
/**
 * Prepares the callback for removal of the temporary file.
 *
 * @param {string} name the path of the file
 * @param {number} fd file descriptor
 * @param {Object} opts
 * @returns {fileCallback}
 * @private
 */
Prepares the callback for removal of the temporary file.
Prepares the callback for removal of the temporary file .
function _prepareTmpFileRemoveCallback(name, fd, opts) {
  const removeCallback = _prepareRemoveCallback(function _removeCallback(fdPath) {
    try {
      if (0 <= fdPath[0]) {
        fs.closeSync(fdPath[0]);
      }
    }
    catch (e) {
      if (!isEBADF(e) && !isENOENT(e)) {
        throw e;
      }
    }
    try {
      fs.unlinkSync(fdPath[1]);
    }
    catch (e) {
      if (!isENOENT(e)) {
        throw e;
      }
    }
  }, [fd, name]);
  if (!opts.keep) {
    _removeObjects.unshift(removeCallback);
  }
  return removeCallback;
}
function _prepareTmpFileRemoveCallback ( name , fd , opts ) { const removeCallback = _prepareRemoveCallback ( function _removeCallback ( fdPath ) { try { if ( 0 <= fdPath [ 0 ] ) { fs . closeSync ( fdPath [ 0 ] ) ; } } catch ( e ) { if ( ! isEBADF ( e ) && ! isENOENT ( e ) ) { throw e ; } } try { fs . unlinkSync ( fdPath [ 1 ] ) ; } catch ( e ) { if ( ! isENOENT ( e ) ) { throw e ; } } } , [ fd , name ] ) ; if ( ! opts . keep ) { _removeObjects . unshift ( removeCallback ) ; } return removeCallback ; }
Prepares the callback for removal of the temporary file.
Prepares the callback for removal of the temporary file .
// under some node/windows related circumstances, a temporary file // may have not be created as expected or the file was already closed // by the user, in which case we will simply ignore the error // reraise any unanticipated error // reraise any unanticipated error