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

Function open

packages/platform/deno/src/DenoFileSystem.ts:328–337  ·  view source on GitHub ↗
(path, options)

Source from the content-addressed store, hash-verified

326}
327
328const open: FileSystem.FileSystem["open"] = (path, options) => {
329 const append = options?.flag?.startsWith("a") ?? false
330 return Effect.map(
331 Effect.acquireRelease(
332 tryPromise("open", path, () => Deno.open(path, openOptions(options?.flag, options?.mode))),
333 (file) => close(file, "open", path)
334 ),
335 (file) => new FileImpl(file, append)
336 )
337}
338
339const makeTempFileFactory = (method: string): FileSystem.FileSystem["makeTempFile"] => (options) =>
340 tryPromise(method, options?.directory, () =>

Callers

nothing calls this directly

Calls 4

openOptionsFunction · 0.85
tryPromiseFunction · 0.70
closeFunction · 0.70
mapMethod · 0.45

Tested by

no test coverage detected