fs-ext.js
function stringToFlockFlags(flag) {
  // Only mess with strings
  if (typeof flag !== 'string') {
    return flag;
  }
  switch (flag) {
    case 'sh':
      return binding.LOCK_SH;

    case 'ex':
      return binding.LOCK_EX;

    case 'shnb':
      return binding.LOCK_SH | binding.LOCK_NB;

    case 'exnb':
      return binding.LOCK_EX | binding.LOCK_NB;

    case 'un':
      return binding.LOCK_UN;

    default:
      throw new Error('Unknown flock flag: ' + flag);
  }
}
function stringToFlockFlags(flag) {
  // Only mess with strings
  if (typeof flag !== 'string') {
    return flag;
  }
  switch (flag) {
    case 'sh':
      return binding.LOCK_SH;

    case 'ex':
      return binding.LOCK_EX;

    case 'shnb':
      return binding.LOCK_SH | binding.LOCK_NB;

    case 'exnb':
      return binding.LOCK_EX | binding.LOCK_NB;

    case 'un':
      return binding.LOCK_UN;

    default:
      throw new Error('Unknown flock flag: ' + flag);
  }
}
function stringToFlockFlags ( flag ) { // Only mess with strings if ( typeof flag !== 'string' ) { return flag ; } switch ( flag ) { case 'sh' : return binding . LOCK_SH ; case 'ex' : return binding . LOCK_EX ; case 'shnb' : return binding . LOCK_SH | binding . LOCK_NB ; case 'exnb' : return binding . LOCK_EX | binding . LOCK_NB ; case 'un' : return binding . LOCK_UN ; default : throw new Error ( 'Unknown flock flag: ' + flag ) ; } }
Used by flock
Used by flock