VFS fixes

This commit is contained in:
Ryan Cavanaugh 2018-05-29 14:28:25 -07:00
parent fe191fec6d
commit 129f747ccc

View file

@ -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();
}
/**