From 129f747ccc478881f67a89d677e7d8661bc48db5 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Tue, 29 May 2018 14:28:25 -0700 Subject: [PATCH] VFS fixes --- src/harness/vfs.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/harness/vfs.ts b/src/harness/vfs.ts index be8b6c3fed7..ba5905b8ea6 100644 --- a/src/harness/vfs.ts +++ b/src/harness/vfs.ts @@ -414,12 +414,16 @@ namespace vfs { * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module. */ public utimesSync(path: string, atime: Date, mtime: Date) { + if (this.isReadonly) throw createIOError("EROFS"); + if (!isFinite(+atime) || !isFinite(+mtime)) throw createIOError("EINVAL"); + const entry = this._walk(this._resolve(path)); if (!entry || !entry.node) { throw createIOError("ENOENT"); } entry.node.atimeMs = +atime; entry.node.mtimeMs = +mtime; + entry.node.ctimeMs = this.time(); } /**