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

Method statSync

packages/dofs/src/provider.ts:178–193  ·  view source on GitHub ↗
(path: string, _options?: { bigint?: boolean })

Source from the content-addressed store, hash-verified

176 }
177
178 statSync(path: string, _options?: { bigint?: boolean }): VirtualStatsLike {
179 // statImpl resolves the path once (following symlinks) and returns
180 // the inode, so nlink comes from the same walk. A pending-create
181 // file reports inode 0, which yields nlink 1.
182 const s = statImpl(this.db, path);
183 return wrapStats({
184 mode: s.mode,
185 size: s.size,
186 mtimeMs: s.mtime,
187 ino: s.inode,
188 isFile: s.isFile,
189 isDirectory: s.isDirectory,
190 isSymbolicLink: false,
191 nlink: linkCount(this.db, s.inode),
192 });
193 }
194
195 lstat(path: string, options?: { bigint?: boolean }): Promise<VirtualStatsLike> {
196 return Promise.resolve(this.lstatSync(path, options));

Callers 12

statMethod · 0.95
writeSyncMethod · 0.95
fstatSyncMethod · 0.95
provider.test.tsFile · 0.80
assertUnchangedFunction · 0.80
fs-ops.bench.tsFile · 0.80
safeVfsStatFunction · 0.80
shim.test.tsFile · 0.80
openFunction · 0.80
opendirFunction · 0.80
driver.test.tsFile · 0.80

Calls 2

wrapStatsFunction · 0.85
linkCountFunction · 0.85

Tested by 1

assertUnchangedFunction · 0.64