MCPcopy Index your code
hub / github.com/Effect-TS/effect / write

Method write

packages/platform-node-shared/src/internal/fileSystem.ts:323–339  ·  view source on GitHub ↗
(buffer: Uint8Array)

Source from the content-addressed store, hash-verified

321 }
322
323 write(buffer: Uint8Array) {
324 return this.semaphore.withPermits(1)(
325 Effect.map(
326 Effect.suspend(() =>
327 nodeWrite(this.fd, buffer, undefined, undefined, this.append ? undefined : Number(this.position))
328 ),
329 (bytesWritten) => {
330 const sizeWritten = FileSystem.Size(bytesWritten)
331 if (!this.append) {
332 this.position = this.position + sizeWritten
333 }
334
335 return sizeWritten
336 }
337 )
338 )
339 }
340
341 private writeAllChunk(buffer: Uint8Array): Effect.Effect<void, Error.PlatformError> {
342 return Effect.flatMap(

Callers

nothing calls this directly

Calls 3

NumberInterface · 0.85
withPermitsMethod · 0.80
mapMethod · 0.65

Tested by

no test coverage detected