MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / readFile

Method readFile

packages/vscode-shim/src/api/FileSystemAPI.ts:37–49  ·  view source on GitHub ↗
(uri: Uri)

Source from the content-addressed store, hash-verified

35 }
36
37 async readFile(uri: Uri): Promise<Uint8Array> {
38 try {
39 const content = fs.readFileSync(uri.fsPath)
40 return new Uint8Array(content)
41 } catch (error) {
42 // Check if it's a file not found error (ENOENT)
43 if ((error as NodeJS.ErrnoException).code === "ENOENT") {
44 throw FileSystemError.FileNotFound(uri)
45 }
46 // For other errors, throw a generic FileSystemError
47 throw new FileSystemError(`Failed to read file: ${uri.fsPath}`)
48 }
49 }
50
51 async writeFile(uri: Uri, content: Uint8Array): Promise<void> {
52 try {

Callers 6

getStatusMethod · 0.45
parseIgnoreFileMethod · 0.45
readJsonFileFunction · 0.45

Calls 1

FileNotFoundMethod · 0.80

Tested by

no test coverage detected