MCPcopy
hub / github.com/remotely-save/remotely-save / stat

Method stat

src/fsLocal.ts:127–145  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

125 }
126
127 async stat(key: string): Promise<Entity> {
128 const statRes = await statFix(this.vault, key);
129 if (statRes === undefined || statRes === null) {
130 throw Error(`${key} does not exist! cannot stat for local`);
131 }
132 const isFolder = statRes.type === "folder";
133 return {
134 key: isFolder ? `${key}/` : key, // local always unencrypted
135 keyRaw: isFolder ? `${key}/` : key,
136 ctimeCli: statRes.ctime,
137 mtimeCli: statRes.mtime,
138 mtimeSvr: statRes.mtime,
139 ctimeCliFmt: unixTimeToStr(statRes.ctime),
140 mtimeCliFmt: unixTimeToStr(statRes.mtime),
141 mtimeSvrFmt: unixTimeToStr(statRes.mtime),
142 size: statRes.size, // local always unencrypted
143 sizeRaw: statRes.size,
144 };
145 }
146
147 async mkdir(key: string, mtime?: number, ctime?: number): Promise<Entity> {
148 // console.debug(`mkdir: ${key}`);

Callers 3

mkdirMethod · 0.95
writeFileMethod · 0.95

Calls 2

statFixFunction · 0.90
unixTimeToStrFunction · 0.90

Tested by

no test coverage detected