Skip to content

Commit f04892c

Browse files
committed
Add comments
1 parent a6e22e4 commit f04892c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

system/lib/wasmfs/backends/node_backend.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ class NodeState {
2323
int fd = -1;
2424

2525
public:
26+
// Base path in the host filesystem for this backend.
27+
// An empty string means "no base path": paths are used as-is without
28+
// prefixing.
2629
std::string path;
2730

2831
NodeState(std::string path) : path(path) {}

system/lib/wasmfs/backends/noderawfs_root.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@
66
#include "emscripten/wasmfs.h"
77

88
backend_t wasmfs_create_root_dir(void) {
9+
// Use an empty string as the backend "path" to indicate that this backend
10+
// is mounted at the real filesystem root. In this mode, paths are passed
11+
// through verbatim (no "./" prefix or path rewriting), which is required
12+
// for correct handling of absolute paths under NODERAWFS.
913
return wasmfs_create_node_backend("");
1014
}

0 commit comments

Comments
 (0)