filehandle.readFile(options)


    异步地读取文件的全部内容。

    • options <Object> | <string>
    • Returns: <Promise> Fulfills upon a successful read with the contents of the file. If no encoding is specified (using options.encoding), the data is returned as a <Buffer> object. Otherwise, the data will be a string.

    Asynchronously reads the entire contents of a file.

    If options is a string, then it specifies the encoding.

    The <FileHandle> has to support reading.

    If one or more filehandle.read() calls are made on a file handle and then a filehandle.readFile() call is made, the data will be read from the current position till the end of the file. It doesn't always read from the beginning of the file.