deno.seeker
继承关系
- Seeker
被谁实现
索引
Methods
Methods
seek
-
seek(offset: number, whence: SeekMode): Promise<number>
-
设置下一个
read()
或write()
的偏移量,根据whence
进行决定从哪个位置开始偏移:SEEK_START
表示相对于文件开头,SEEK_CURRENT
表示相对于当前位置,SEEK_END
表示相对于文件末尾。 Seek 解析(resolve)的值为相对于文件开头的新偏移量。Seek sets the offset for the next
read()
orwrite()
to offset, interpreted according towhence
:SEEK_START
means relative to the start of the file,SEEK_CURRENT
means relative to the current offset, andSEEK_END
means relative to the end. Seek resolves to the new offset relative to the start of the file.把偏移量设置到文件开始之前是错误的。 设置任何正偏移都是合法的,但是对于之后的 I/O 操作的行为则取决于实现。 它返回设置之后的偏移位置。
Seeking to an offset before the start of the file is an error. Seeking to any positive offset is legal, but the behavior of subsequent I/O operations on the underlying object is implementation-dependent. It returns the number of cursor position.
参数
-
offset: number
-
whence: SeekMode
返回 Promise<number>
-
图例说明
- Method
本文档使用 TypeDoc 生成。