MCPcopy Index your code
hub / github.com/nodejs/node / stat_resource

Function stat_resource

test/parallel/test-fs-utimes.js:35–46  ·  view source on GitHub ↗
(resource, statSync = fs.statSync)

Source from the content-addressed store, hash-verified

33fs.symlinkSync('unoent-entry', lpath);
34
35function stat_resource(resource, statSync = fs.statSync) {
36 if (typeof resource === 'string') {
37 return statSync(resource);
38 }
39 const stats = fs.fstatSync(resource);
40 // Ensure mtime has been written to disk
41 // except for directories on AIX where it cannot be synced
42 if ((common.isAIX || common.isIBMi) && stats.isDirectory())
43 return stats;
44 fs.fsyncSync(resource);
45 return fs.fstatSync(resource);
46}
47
48function check_mtime(resource, mtime, statSync) {
49 mtime = fs._toUnixTimestamp(mtime);

Callers 1

check_mtimeFunction · 0.85

Calls 3

fstatSyncMethod · 0.80
statSyncFunction · 0.50
isDirectoryMethod · 0.45

Tested by

no test coverage detected