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

Function access

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

Source from the content-addressed store, hash-verified

48 })
49
50const access: FileSystem.FileSystem["access"] = (path, options) => {
51 if (!options?.readable && !options?.writable) {
52 return Effect.asVoid(tryPromise("access", path, () => Deno.stat(path)))
53 }
54 return Effect.acquireUseRelease(
55 tryPromise("access", path, () =>
56 Deno.open(path, {
57 ...(options.readable ? { read: true } : {}),
58 ...(options.writable ? { write: true } : {})
59 })),
60 () => Effect.void,
61 (file) => close(file, "access", path)
62 )
63}
64
65const copy: FileSystem.FileSystem["copy"] = (fromPath, toPath, options) =>
66 tryPromise("copy", fromPath, () =>

Callers

nothing calls this directly

Calls 4

tryPromiseFunction · 0.70
closeFunction · 0.70
statMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected