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

Method read

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

Source from the content-addressed store, hash-verified

262 }
263
264 read(buffer: Uint8Array) {
265 return this.semaphore.withPermits(1)(
266 Effect.map(
267 Effect.suspend(() =>
268 nodeRead(this.fd, {
269 buffer,
270 position: this.position
271 })
272 ),
273 (bytesRead) => {
274 const sizeRead = FileSystem.Size(bytesRead)
275 this.position = this.position + sizeRead
276 return sizeRead
277 }
278 )
279 )
280 }
281
282 readAlloc(size: FileSystem.SizeInput) {
283 const sizeNumber = Number(size)

Callers 10

Clipboard.tsFile · 0.80
unsafeReadableReadFunction · 0.80
fileContentFunction · 0.80
fileContentFunction · 0.80
runRawFunction · 0.80
reading.test.tsFile · 0.80
mapping.test.tsFile · 0.80
fromReadableStreamFunction · 0.80
executeStreamMethod · 0.80

Calls 2

withPermitsMethod · 0.80
mapMethod · 0.65

Tested by

no test coverage detected