温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/node/fs/read
点击访问原文链接

Node fs.read function | API Reference | Bun

Node fs.read function | API Reference | BunBuildDocsReferenceGuidesBlogDiscord/node:fs/readNread

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:fs/readNread

namespace

fs.readfunction readTBuffer extends ArrayBufferViewArrayBufferLike>>(fd: number,buffer: TBuffer,offset: number,length: number,position: null | ReadPosition,callback: (err: null | ErrnoException, bytesRead: number, buffer: TBuffer) => void): void;

Read data from the file specified by fd.

The callback is given the three arguments, (err, bytesRead, buffer).

If the file is not modified concurrently, the end-of-file is reached when the number of bytes read is zero.

If this method is invoked as its util.promisify() ed version, it returns a promise for an Object with bytesRead and buffer properties.

@param buffer

The buffer that the data will be written to.

@param offset

The position in buffer to write the data to.

@param length

The number of bytes to read.

@param position

Specifies where to begin reading from in the file. If position is null or -1 , data will be read from the current file position, and the file position will be updated. If position is an integer, the file position will be unchanged.

function readTBuffer extends ArrayBufferViewArrayBufferLike> = NonSharedBuffer>(fd: number,options: ReadOptionsWithBufferTBuffer>,callback: (err: null | ErrnoException, bytesRead: number, buffer: TBuffer) => void): void;

Similar to the above fs.read function, this version takes an optional options object. If not otherwise specified in an options object, buffer defaults to Buffer.alloc(16384), offset defaults to 0, length defaults to buffer.byteLength, - offset as of Node 17.6.0 position defaults to null

function readTBuffer extends ArrayBufferViewArrayBufferLike>>(fd: number,buffer: TBuffer,options: ReadOptions,callback: (err: null | ErrnoException, bytesRead: number, buffer: TBuffer) => void): void;

Read data from the file specified by fd.

The callback is given the three arguments, (err, bytesRead, buffer).

If the file is not modified concurrently, the end-of-file is reached when the number of bytes read is zero.

If this method is invoked as its util.promisify() ed version, it returns a promise for an Object with bytesRead and buffer properties.

@param buffer

The buffer that the data will be written to.

function readTBuffer extends ArrayBufferViewArrayBufferLike>>(fd: number,buffer: TBuffer,callback: (err: null | ErrnoException, bytesRead: number, buffer: TBuffer) => void): void;

Read data from the file specified by fd.

The callback is given the three arguments, (err, bytesRead, buffer).

If the file is not modified concurrently, the end-of-file is reached when the number of bytes read is zero.

If this method is invoked as its util.promisify() ed version, it returns a promise for an Object with bytesRead and buffer properties.

@param buffer

The buffer that the data will be written to.

function read(fd: number,callback: (err: null | ErrnoException, bytesRead: number, buffer: NonSharedBuffer) => void): void;

Read data from the file specified by fd.

The callback is given the three arguments, (err, bytesRead, buffer).

If the file is not modified concurrently, the end-of-file is reached when the number of bytes read is zero.

If this method is invoked as its util.promisify() ed version, it returns a promise for an Object with bytesRead and buffer properties.

namespace read

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

Node fs.read function | API Reference | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for namespace node:fs.read | Bun