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

Function chmod

src/lib/libnoderawfs.js:117–128  ·  view source on GitHub ↗
(path, mode, dontFollow)

Source from the content-addressed store, hash-verified

115 return FS.statfs(stream.path);
116 },
117 chmod(path, mode, dontFollow) {
118 mode &= {{{ cDefs.S_IALLUGO }}};
119 if (NODEFS.isWindows) {
120 // Windows only supports S_IREAD / S_IWRITE (S_IRUSR / S_IWUSR)
121 // https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/chmod-wchmod
122 mode &= {{{ cDefs.S_IRUSR | cDefs.S_IWUSR }}};
123 }
124 if (dontFollow && fs.lstatSync(path).isSymbolicLink()) {
125 // Node (and indeed linux) does not support chmod on symlinks
126 // https://nodejs.org/api/fs.html#fslchmodsyncpath-mode
127 throw new FS.ErrnoError({{{ cDefs.EOPNOTSUPP }}});
128 }
129 fs.chmodSync(path, mode);
130 },
131 fchmod(fd, mode) {

Callers 1

doChmodFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected