MCPcopy Create free account
hub / github.com/Effect-TS/effect / write

Method write

packages/platform/node-shared/src/NodeFileSystem.ts:340–354  ·  view source on GitHub ↗
(buffer: Uint8Array)

Source from the content-addressed store, hash-verified

338 }
339
340 write(buffer: Uint8Array) {
341 return Effect.suspend(() => {
342 const position = this.position
343 return Effect.map(
344 nodeWrite(this.fd, buffer, undefined, undefined, this.append ? undefined : Number(position)),
345 (bytesWritten) => {
346 const sizeWritten = FileSystem.Size(bytesWritten)
347 if (!this.append) {
348 this.position = position + sizeWritten
349 }
350 return sizeWritten
351 }
352 )
353 })
354 }
355
356 private writeAllChunk(buffer: Uint8Array): Effect.Effect<void, Error.PlatformError> {
357 return Effect.suspend(() => {

Callers

nothing calls this directly

Calls 2

NumberInterface · 0.50
mapMethod · 0.45

Tested by

no test coverage detected