| 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) { |