(path, data, opts = {})
| 2835 | return ret; |
| 2836 | }, |
| 2837 | writeFile(path, data, opts = {}) { |
| 2838 | opts.flags = opts.flags || 577; |
| 2839 | var stream = FS.open(path, opts.flags, opts.mode); |
| 2840 | if (typeof data == 'string') { |
| 2841 | var buf = new Uint8Array(lengthBytesUTF8(data) + 1); |
| 2842 | var actualNumBytes = stringToUTF8Array(data, buf, 0, buf.length); |
| 2843 | FS.write(stream, buf, 0, actualNumBytes, undefined, opts.canOwn); |
| 2844 | } else if (ArrayBuffer.isView(data)) { |
| 2845 | FS.write(stream, data, 0, data.byteLength, undefined, opts.canOwn); |
| 2846 | } else { |
| 2847 | throw new Error('Unsupported data type'); |
| 2848 | } |
| 2849 | FS.close(stream); |
| 2850 | }, |
| 2851 | cwd: () => FS.currentPath, |
| 2852 | chdir(path) { |
| 2853 | var lookup = FS.lookupPath(path, { follow: true }); |
nothing calls this directly
no test coverage detected