MCPcopy Create free account
hub / github.com/cloudflare/computer / statOrNull

Method statOrNull

packages/computer/src/stub.ts:132–146  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

130 }
131
132 async statOrNull(path: string): Promise<WorkspaceStatResult | null> {
133 return withSpan(
134 this.#ws.observer,
135 "workspace.fs.statOrNull",
136 { "workspace.fs.path": path },
137 async () => {
138 try {
139 return await this.#ws.fs.stat(path);
140 } catch (error) {
141 if ((error as { code?: string }).code === "ENOENT") return null;
142 throw error;
143 }
144 },
145 );
146 }
147
148 lstat(path: string): Promise<WorkspaceStatResult> {
149 return withSpan(this.#ws.observer, "workspace.fs.lstat", { "workspace.fs.path": path }, () =>

Callers 1

existsMethod · 0.95

Calls 2

withSpanFunction · 0.85
statMethod · 0.65

Tested by

no test coverage detected