MCPcopy
hub / github.com/Effect-TS/effect / seek

Method seek

packages/platform-node-shared/src/internal/fileSystem.ts:249–262  ·  view source on GitHub ↗
(offset: FileSystem.SizeInput, from: FileSystem.SeekMode)

Source from the content-addressed store, hash-verified

247 }
248
249 seek(offset: FileSystem.SizeInput, from: FileSystem.SeekMode) {
250 const offsetSize = FileSystem.Size(offset)
251 return this.semaphore.withPermits(1)(
252 Effect.sync(() => {
253 if (from === "start") {
254 this.position = offsetSize
255 } else if (from === "current") {
256 this.position = this.position + offsetSize
257 }
258
259 return this.position
260 })
261 )
262 }
263
264 read(buffer: Uint8Array) {
265 return this.semaphore.withPermits(1)(

Callers 3

FileSystem.test.tsFile · 0.80
makeFunction · 0.80
TQueue.test.tsFile · 0.80

Calls 2

withPermitsMethod · 0.80
syncMethod · 0.80

Tested by

no test coverage detected