The `FileWriter` class.

@param {String} path The file path to write the WAVE file to
@param {Object} opts Object contains options for the stream and format info
@api public
517351
function FileWriter (path, opts) {
  if (!(this instanceof FileWriter)) return new FileWriter(path, opts);
  Writer.call(this, opts);
  this.path = path;
  this.file = fs.createWriteStream(path, opts);
  this.pipe(this.file);
  this.on('header', this._onHeader);
}
52995
function writeOpts(opts) {
  return utils.extend({
    flags: opts.flags || (opts.overwrite ? 'w' : 'wx')
  }, opts);
}
1352886
function createSourceMapFile(opts) {
  return new File({
    cwd: opts.cwd,
    base: opts.base,
    path: opts.path,
    contents: new Buffer(JSON.stringify(opts.content)),
    stat: {
      isFile: function() {
        return true;
      },
      isDirectory: function() {
        return false;
      },
      isBlockDevice: function() {
        return false;
      },
      isCharacterDevice: function() {
        return false;
      },
      isSymbolicLink: function() {
        return false;
      },
      isFIFO: function() {
        return false;
      },
      isSocket: function() {
        return false;
      },
    },
  });
}
122251
function Uploader( opts ) {
            this.options = $.extend( true, {}, Uploader.options, opts );
            this._init( this.options );
        }
226205
function writeFile(path, contents, mode, cb) {
    fs.writeFile(path, contents, {mode: mode || 0666, encoding: 'utf8'}, function (err) {
        if (err) { throw err; }
        console.info(cliStyles.cyan + '\tcreate' + cliStyles.reset + ': ' + path);
        cb();
    });
}
407761
function startline(opt) {

  var options = opt || Object.create(null);

  // file
  var file;
  if (Boolean(options.file)) {
    file = require('path').resolve(String(options.file));
    if (!fs.existsSync(file)) {
      throw new Error('file does not exist');
    }
    if (!fs.statSync(file).isFile()) {
      throw new Error('path is not a file');
    }
  } else {
    throw new Error('"file" is required');
  }

  // clean
  var my = {
    file: file,
    encoding: options.encoding,
    flag: String(options.flag || 'r'),
    mode: Number(options.mode) || 444,
    autoClose: options.autoClose === false ? false : true,
    start: Number(options.start) || 0,
    end: Number(options.end),
    rc4: options.rc4,
    autokey: options.autokey,
    lodash: Boolean(options.autokey),
  };

  return new Startline(my);
}
487747
function saveFiles(path, opts, obj, cb) {
  const noDot = opts.noDot
  var root  = ''

  walk.walk(path, walkFn, function (err) {
    if (err) cb(err)
    cb(null, obj)
  })

  function walkFn(baseDir, filename, stat, next) {
    if (!root) root = baseDir
    baseDir = stripLeadingSlash(baseDir.split(root)[1])

    if (stat.isDirectory()) return next()
    if (noDot) {
      if (/^\./.test(filename)) return next()
    }
    pushArr(baseDir, obj, filename)
    next()
  }
}
330054
function(path, opts) {
        opts = opts || {};
        this.dir = PATH.resolve(path.path || path);
        this.projectRoot = opts.projectRoot || PATH.resolve('');

        // NOTE: keep this.path for backwards compatibility
        this.path = this.bemDir = PATH.join(this.dir, '.bem');

        path = PATH.relative(this.projectRoot, this.dir);
        this.cache = useCache;
        for(var e in exceptLevels) {
            var except = exceptLevels[e];
            if (path.substr(0, except.length) === except) {
                this.cache = !this.cache;
                break;
            }
        }

        // NOTE: tech modules cache
        this._techsCache = {};
    }
496238
function grabImages (opts) {
  if (!opts.quiet) console.log(multiline(function () {/*

 _ _|                  |                                    |
   |    __ \     __|   __|    _` |    _` |    __|    _` |   __ \
   |    |   |  \__ \   |     (   |   (   |   |      (   |   |   |
 ___|  _|  _|  ____/  \__|  \__,_|  \__, |  _|     \__,_|  _.__/
                                    |___/

*/}))

  opts.shortcode.forEach(function (shortcode) {
    // set up the sink
    var filename = instagrab.filename(shortcode, opts.size)
    var filepath = path.join(process.cwd(), filename)
    var toFile = fs.createWriteStream(filepath)
    toFile.on('error', onSaveError(shortcode))
    toFile.on('finish', function onSaved () {
      if (this.quiet) return;
      console.log('grabbed: ', filename)
    })

    // grab the bits
    return instagrab(shortcode, opts.size)
      .on('error', onGrabError(shortcode))
      .pipe(toFile)
  })
}
454554
function fileInclude(opts) {

    var file = opts,
        func = null,
        args = null,
        elems,
        result;

    if (file.indexOf('?') !== -1) {
        elems = file.split('?');
        file = elems.shift();
        args = querystring.parse(elems.join('?'));
    }

    if (file.indexOf('#') !== -1) {
        elems = file.split('#');
        file = elems.shift();
        func = elems[0] ? elems[0].replace(/^\s+|\s+$/, '') : null;
    }

    result = require(path.join(process.cwd(), file));

    if (func !== null) {
        result = result[func];
    }

    if (!!(result && result.constructor && result.call && result.apply)) {
        if (args) {
            result = result.apply(null, [args]);
        } else {
            result = result();
        }
    }

    if (!result) {
        return {};
    }

    return result;
}
1189860
function(filePath, options) {
            var clientOptions = {};
            if (options && options !== null) {
                if (typeof options.headers === "object") {
                    clientOptions.headers = options.headers;
                }
            }
            return client.createWriteStream(filePath, clientOptions);
        }
1130056
def send_file(path, opts = {})
      if opts[:type] or not response['Content-Type']
        content_type opts[:type] || File.extname(path), :default => 'application/octet-stream'
      end

      disposition = opts[:disposition]
      filename    = opts[:filename]
      disposition = :attachment if disposition.nil? and filename
      filename    = path        if filename.nil?
      attachment(filename, disposition) if disposition

      last_modified opts[:last_modified] if opts[:last_modified]

      file   = Rack::File.new(File.dirname(settings.app_file))
      result = file.serving(request, path)

      result[1].each { |k,v| headers[k] ||= v }
      headers['Content-Length'] = result[1]['Content-Length']
      opts[:status] &&= Integer(opts[:status])
      halt (opts[:status] || result[0]), result[2]
    rescue Errno::ENOENT
      not_found
    end
515172
function writeFile (file, callback) {
  fs.outputFile(path.resolve(this._destination, path.join(file.path.dir, file.path.name + file.path.ext)), file.content, function (err) {
    if (err) callback(err);
    callback(null);
  });
}
1088558
function concatenateAndWriteFile(files, destination, separator) {
			if (!destination || !files || !files.length) return;

			files = _.map(files, process);

			var src = files.join(separator || grunt.util.linefeed);
			grunt.file.write(destination, src);
			grunt.log.writeln('File ' + destination.cyan + ' created.');
		}
910330
function readFileSync( path, opts ) {
	var file;
	try {
		if ( arguments.length > 1 ) {
			file = fs.readFileSync( path, opts );
		} else {
			file = fs.readFileSync( path );
		}
	} catch ( err ) {
		return err;
	}
	return file;
}
16545
function defaults(opts) {
  opts = opts || {}

  if (!opts.streamer) {
    throw new Error('No streamer found. Must pass a streamer to multipart-pipe')
  }

  opts.limit = opts.limit === undefined ? '128mb' : opts.limit;
  opts.limit = typeof opts.limit === 'string' ? parseBytes(opts.limit) : opts.limit;
  opts.allow = opts.allow instanceof RegExp ? opts.allow : new RegExp(opts.allow || '.*');

  if (!opts.filename || typeof opts.filename !== 'function') {
    opts.filename = function (filename, mime) { return filename; };
  }

  return opts
}
226123
function MuteStream (opts) {
  Stream.apply(this)
  opts = opts || {}
  this.writable = this.readable = true
  this.muted = false
  this.on('pipe', this._onpipe)
  this.replace = opts.replace

  // For readline-type situations
  // This much at the start of a line being redrawn after a ctrl char
  // is seen (such as backspace) won't be redrawn as the replacement
  this._prompt = opts.prompt || null
  this._hadControl = false
}