Unix.files = function(paths, end) {
  var self = this;
  assertPaths('paths', paths);
  assertFunction('end', end);
  var files = {};
  var queue = new Queue(1); // Concurrency yields no improvement with lsof.
  queue.onData = function(paths, end) {
    var command = 'lsof';
    var args = ['-F', 'n', '--'].concat(paths);
    var options = {
      encoding: 'utf-8',
      maxBuffer: 2 * 1024 * 1024
    };
    Node.child.execFile(command, args, options,
      function(error, stdout, stderr) {
        // lsof returns an error and a status code of 1 if a file is not open:
        if (error && error.code === 1 && stderr.length === 0) error = undefined;
        if (error) {
          if (/No such file or directory/i.test(stderr)) {
            error.code = 'ENOENT';
          }
          return end(error);
        }
        var lines = stdout.split('\n');
        for (var index = 0, length = lines.length; index < length; index++) {
          var line = lines[index];
          if (line[0] != 'n') continue;
          var candidate = self.unescape(line.slice(1));
          if (files.hasOwnProperty(candidate)) files[candidate] = true;
        }
        end();
      }
    );
  };
  queue.onEnd = function(error) {
    if (error) return end(error);
    end(undefined, files);
  };
  // lsof performs in constant time regardless of the number of paths.
  // We therefore batch calls to lsof to improve latency.
  // We must be careful however not to exceed any limits on command length.
  // 32 paths at 32768 bytes per path requires just over 1 MB.
  // We assume we are safe up to 2 MB.
  // See: xargs --show-limits
  var batch = [];
  for (var index = 0, length = paths.length; index < length; index++) {
    var path = paths[index];
    if (files.hasOwnProperty(path)) continue;
    files[path] = false;
    batch.push(path);
    if (batch.length === 32) {
      queue.push(batch);
      batch = [];
    }
  }
  if (batch.length) queue.push(batch);
  queue.end();
};
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.