mirror of https://github.com/pyodide/pyodide.git
39 lines
1.3 KiB
Diff
39 lines
1.3 KiB
Diff
Modify MEMFS to update timestamp of parent directory on file creation and removal.
|
|
More POSIXish compliant for a one timestamp fs, behaves like a modification date.
|
|
|
|
--- a/emsdk/fastcomp/emscripten/src/library_memfs.js 2019-08-19 18:11:40.000000000 +0200
|
|
+++ b/emsdk/fastcomp/emscripten/src/library_memfs.js 2020-12-23 12:22:38.000000000 +0100
|
|
@@ -88,6 +88,7 @@
|
|
// add the new node to the parent
|
|
if (parent) {
|
|
parent.contents[name] = node;
|
|
+ parent.timestamp = node.timestamp;
|
|
}
|
|
return node;
|
|
},
|
|
@@ -213,12 +214,16 @@
|
|
}
|
|
// do the internal rewiring
|
|
delete old_node.parent.contents[old_node.name];
|
|
+ var now = Date.now();
|
|
+ old_node.parent.timestamp = now;
|
|
old_node.name = new_name;
|
|
new_dir.contents[new_name] = old_node;
|
|
+ new_dir.timestamp = now;
|
|
old_node.parent = new_dir;
|
|
},
|
|
unlink: function(parent, name) {
|
|
delete parent.contents[name];
|
|
+ parent.timestamp = Date.now();
|
|
},
|
|
rmdir: function(parent, name) {
|
|
var node = FS.lookupNode(parent, name);
|
|
@@ -226,6 +231,7 @@
|
|
throw new FS.ErrnoError({{{ cDefine('ENOTEMPTY') }}});
|
|
}
|
|
delete parent.contents[name];
|
|
+ parent.timestamp = Date.now();
|
|
},
|
|
readdir: function(node) {
|
|
var entries = ['.', '..'];
|