Sync method for getting `file.contents`.

@param  {Object} `file`
@param  {Object} `options`
@return {Object}
179223
function contentsSync(file, options) {
  if (!utils.isObject(file)) {
    throw new TypeError('expected file to be an object');
  }

  try {
    // ideally we want to stat the real, initial filepath
    file.stat = fs.lstatSync(file.history[0]);
  } catch (err) {
    try {
      // if that doesn't work, try again
      file.stat = fs.lstatSync(file.path);
    } catch (err) {
      file.stat = new fs.Stats();
    }
  }

  utils.syncContents(file, options);
  return file;
}
365478
function (files) {
  if (files.length === 1) {
    return { file: files[0] };
  } else {
    var contents = files.map(function (fname) {
      return '@import ' + JSON.stringify(fname) + ';';
    }).join('\n');

    return { contents: contents };
  }
}
89296
public static ConfigDocument parseFile(File file, ConfigParseOptions options) {
        return Parseable.newFile(file, options).parseConfigDocument();
    }
1104429
function(buffer, callback, options) {
        if (options && options.type === 'url') {
            readers.getContentsFromUrl(buffer, function(err, data) {
                if (err) {
                    return callback(err);
                }

                module.exports.md5(data, callback, { binary: true });
            });
        } else if (buffer instanceof window.File) {
            readers.getContentsFromFile(buffer, function(err, data) {
                if (err) {
                    return callback(err);
                }

                module.exports.md5(data, callback, { binary: true });
            });
        } else {
            // ArrayBuffer, then.
            process.nextTick(function() {
                addMd5Task(buffer, callback);
            });
        }
    }
974166
function parseMatter(file, options) {
  const opts = defaults(options);
  const open = opts.delimiters[0];
  const close = '\n' + opts.delimiters[1];
  let str = file.content;

  if (opts.language) {
    file.language = opts.language;
  }

  // get the length of the opening delimiter
  const openLen = open.length;
  if (!utils.startsWith(str, open, openLen)) {
    excerpt(file, opts);
    return file;
  }

  // if the next character after the opening delimiter is
  // a character from the delimiter, then it's not a front-
  // matter delimiter
  if (str.charAt(openLen) === open.slice(-1)) {
    return file;
  }

  // strip the opening delimiter
  str = str.slice(openLen);
  const len = str.length;

  // use the language defined after first delimiter, if it exists
  const language = matter.language(str, opts);
  if (language.name) {
    file.language = language.name;
    str = str.slice(language.raw.length);
  }

  // get the index of the closing delimiter
  let closeIndex = str.indexOf(close);
  if (closeIndex === -1) {
    closeIndex = len;
  }

  // get the raw front-matter block
  file.matter = str.slice(0, closeIndex);

  const block = file.matter.replace(/^\s*#[^\n]+/gm, '').trim();
  if (block === '') {
    file.isEmpty = true;
    file.empty = file.content;
    file.data = {};
  } else {

    // create file.data by parsing the raw file.matter block
    file.data = parse(file.language, file.matter, opts);
  }

  // update file.content
  if (closeIndex === len) {
    file.content = '';
  } else {
    file.content = str.slice(closeIndex + close.length);
    if (file.content[0] === '\r') {
      file.content = file.content.slice(1);
    }
    if (file.content[0] === '\n') {
      file.content = file.content.slice(1);
    }
  }

  excerpt(file, opts);

  if (opts.sections === true || typeof opts.section === 'function') {
    sections(file, opts.section);
  }
  return file;
}
173429
function File(file, options) {
  Item.call(this, file, options);
  this.initFile(file);
  return file;
}
1262090
function(file) {
    if (!AST.cache) {
      return;
    }
    else if (typeof file === 'string') {
      if (!AST.cache[file]) AST.cache[file] = null;
    }
    else if (file.isParsed() && !file.timestamp) {
      file.timestamp = Date.now();
      AST.cache[file.file] = file;
    }
  }
915179
function createNewFileByContents(file, newContents) {

  var newFile = file.clone()

  newFile.contents = newContents

  return newFile
}
178663
function getUrl (file) {

            if (!that.ignore(file)) {
                file = that.map(file);
                file = utils.normalize(file);
                return file;
            }
        }
964333
function(file) {
    return fs.openAsync(file, 'r').then((fileDescriptor) => {
      return lzma.parseFileIndexFDAsync(fileDescriptor).tap(() => {
        return fs.closeAsync(fileDescriptor);
      });
    }).then((metadata) => {
      return {
        stream: fs.createReadStream(file)
          .pipe(lzma.createDecompressor()),
        size: metadata.uncompressedSize,
        transform: new PassThroughStream()
      };
    });
  }
605970
function getContentFromNode(options, node) {
	return new Promise(function (resolve, reject) {
		if (node.tag === 'link') {
			return fs.readFile(normalizePath(node.attrs.href, options.root, options.from), 'utf8', function (err, res) {
				return err ? reject(err) : resolve(res);
			});
		}

		return resolve(node.content);
	});
}
530467
function(file) {
    var result = getRawData(file),
        type = utils.getTypeOf(result);
    if (type === "string") {
        if (!file.options.binary) {
            // unicode text !
            // unicode string => binary string is a painful process, check if we can avoid it.
            if (textEncoder) {
                return textEncoder.encode(result);
            }
            if (support.nodebuffer) {
                return nodeBuffer(result, "utf-8");
            }
        }
        return file.asBinary();
    }
    return result;
}
1184747
function (file) {

        var that = this;
        var error = false;
        var walk;

        if (file) {


            var fileList = typeof file === 'string' ? [file] : file;

            fileList = fileList.map(function (file) {
                return path.resolve(that.base, file);
            });

            walk = function (list) {

                list.forEach(function (file) {

                    if (error) {
                        return;
                    }

                    error = !that._compile(file);

                });
            };


            walk(fileList);

            if (!error && this.options.combo) {
                this._combo();
            }

        } else {


            walk = function (dir) {

                if (dir === that.output) {
                    return;
                }

                var dirList = fs.readdirSync(dir);

                dirList.forEach(function (item) {

                    if (error) {
                        return;
                    }

                    if (fs.statSync(path.join(dir, item)).isDirectory()) {
                        walk(path.join(dir, item));
                    } else if (that.filterBasename(item) && that.filterExtname(item)) {
                        error = !that._compile(path.join(dir, item));
                    }

                });
            };


            walk(this.base);

            if (!error && this.options.combo) {
                this._combo();
            }
        }

    }
760886
def __get_file(self, file):
        
        file_object = None
        if file['name'] in request.files:
            file_object = request.files[file['name']]
            clean_filename = secure_filename(file_object.filename)
            if clean_filename == '':
                return file_object
            if file_object and self.__allowed_extension(
                    clean_filename, file['extensions']):
                return file_object
        elif file['name'] not in request.files and file['required']:
            return file_object
        return file_object
1139857
function readFile (file, callback) {
  var schema = file.schema;
  file[__internal].state = STATE_READING;

  if (schema.config.sync) {
    schema.plugins.readFileSync({ file: file });
    doneReading(null);
  }
  else {
    schema.plugins.readFileAsync({ file: file }, doneReading);
  }

  function doneReading (err) {
    if (err) {
      callback(err);
    }
    else {
      file[__internal].state = STATE_READ;
      safeCall(decodeFile, file, callback);
    }
  }
}
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;
}
1070739
function(content, options) {
    var options = options || {},
        content = content || '',
        file = generator.build(options);
    
    try {
      fs.writeFileSync(file, content, options);
      return file;
    }
    catch(e) { throw e; }
  }