MCPcopy Create free account
hub / github.com/cloudflare/agents / stat

Method stat

packages/shell/src/filesystem.ts:500–522  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

498 // ── Metadata ───────────────────────────────────────────────────
499
500 async stat(path: string): Promise<FileStat | null> {
501 await this.ensureInit();
502 const normalized = normalizePath(path);
503 const resolved = await this.resolveSymlink(normalized);
504 const T = this.tableName;
505 const rows = await this.sql.query<{
506 path: string;
507 name: string;
508 type: string;
509 mime_type: string;
510 size: number;
511 created_at: number;
512 modified_at: number;
513 target: string | null;
514 }>(
515 `SELECT path, name, type, mime_type, size, created_at, modified_at, target
516 FROM ${T} WHERE path = ?`,
517 resolved
518 );
519 const r = rows[0];
520 if (!r) return null;
521 return toFileInfo(r);
522 }
523
524 // ── File I/O ───────────────────────────────────────────────────
525

Callers

nothing calls this directly

Calls 4

ensureInitMethod · 0.95
resolveSymlinkMethod · 0.95
toFileInfoFunction · 0.85
normalizePathFunction · 0.70

Tested by

no test coverage detected