<commit_before>var CommandManager = require('../command-manager');
var FS = require('../fs');

CommandManager.register('cat', cat);

function cat(args, stdin, stdout, stderr, next) {
  var out = [];

  args.arguments.forEach(function (arg) {
    var content = FS.open(arg);

    if (content !== undefined) {
      if (typeof(content) === 'string') {
        out.push(content);
      } else {
        out.push(FS.error('cat', arg, 'Is a directory'));
      }
    } else {
      out.push(FS.notFound('cat', arg));
    }
  });

  stdout.write(out.join('\n'));
  next();
}<commit_msg>fix: cat use right output<commit_after>var CommandManager = require('../command-manager');
var FS = require('../fs');

CommandManager.register('cat', cat);

function cat(args, stdin, stdout, stderr, next) {
  args.arguments.forEach(function (arg) {
    var content = FS.open(arg);

    if (content !== undefined) {
      if (typeof(content) === 'string') {
        stdout.write(content);
      } else {
        stderr.write(FS.error('cat', arg, 'Is a directory'));
      }
    } else {
      stderr.write(FS.notFound('cat', arg));
    }
  });

  next();
}
{'fraction_non_alphanumeric': 0.1947136563876652, 'fraction_numerical': 0.0, 'mean_word_length': 2.972027972027972, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1751413', 'n_tokens_mistral': 379, 'n_tokens_neox': 365, 'n_words': 79}