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

Function access

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

tryPromiseFunction · 0.70
closeFunction · 0.70
statMethod · 0.45

Tested by

no test coverage detected