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

Method insertSymlink

system/lib/wasmfs/file.cpp:121–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121std::shared_ptr<Symlink>
122Directory::Handle::insertSymlink(const std::string& name,
123 const std::string& target) {
124 // Cannot insert into an unlinked directory.
125 if (!getParent()) {
126 return nullptr;
127 }
128 auto child = getDir()->insertSymlink(name, target);
129 if (!child) {
130 return nullptr;
131 }
132 cacheChild(name, child, DCacheKind::Normal);
133 updateMTime();
134 return child;
135}
136
137// TODO: consider moving this to be `Backend::move` to avoid asymmetry between
138// the source and destination directories and/or taking `Directory::Handle`

Callers 1

__syscall_symlinkatFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected