MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / initRootDirectory

Method initRootDirectory

system/lib/wasmfs/wasmfs.cpp:100–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100std::shared_ptr<Directory> WasmFS::initRootDirectory() {
101 auto rootBackend = wasmfs_create_root_dir();
102 auto rootDirectory =
103 rootBackend->createDirectory(S_IRUGO | S_IXUGO | S_IWUGO);
104 auto lockedRoot = rootDirectory->locked();
105
106 // The root directory is its own parent.
107 lockedRoot.setParent(rootDirectory);
108
109 // Set up the root directory.
110 rootBackend->populateRoot(lockedRoot);
111
112 return rootDirectory;
113}
114
115// Initialize files specified by the --preload-file option.
116// Set up directories and files in wasmFS$preloadedDirs and

Callers

nothing calls this directly

Calls 5

setParentMethod · 0.80
wasmfs_create_root_dirFunction · 0.70
createDirectoryMethod · 0.45
lockedMethod · 0.45
populateRootMethod · 0.45

Tested by

no test coverage detected