MCPcopy Index your code
hub / github.com/Xyntopia/taskyon / openFile

Function openFile

src/modules/OPFS.ts:101–117  ·  view source on GitHub ↗
(fileName: string)

Source from the content-addressed store, hash-verified

99}
100
101export async function openFile(fileName: string) {
102 console.log('opening file: ', fileName);
103 try {
104 const storageRoot = await getRoot();
105 if (storageRoot) {
106 // Get the file handle:
107 const dirHandle = await storageRoot.getDirectoryHandle('fileuploads');
108 const fileHandle = await dirHandle.getFileHandle(fileName);
109 // Get the file object:
110 const file = await fileHandle.getFile();
111 return file;
112 }
113 } catch (err) {
114 console.error(err);
115 return undefined;
116 }
117}

Callers 2

getFileFunction · 0.90

Calls 1

getRootFunction · 0.85

Tested by

no test coverage detected