Skip to content

Commit 129f747

Browse files
committed
VFS fixes
1 parent fe191fe commit 129f747

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/harness/vfs.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,12 +414,16 @@ namespace vfs {
414414
* NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module.
415415
*/
416416
public utimesSync(path: string, atime: Date, mtime: Date) {
417+
if (this.isReadonly) throw createIOError("EROFS");
418+
if (!isFinite(+atime) || !isFinite(+mtime)) throw createIOError("EINVAL");
419+
417420
const entry = this._walk(this._resolve(path));
418421
if (!entry || !entry.node) {
419422
throw createIOError("ENOENT");
420423
}
421424
entry.node.atimeMs = +atime;
422425
entry.node.mtimeMs = +mtime;
426+
entry.node.ctimeMs = this.time();
423427
}
424428

425429
/**

0 commit comments

Comments
 (0)