MCPcopy Create free account
hub / github.com/diffusionstudio/vits-web / FS_modeStringToFlags

Function FS_modeStringToFlags

src/piper.js:1895–1909  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

1893 }
1894 };
1895 var FS_modeStringToFlags = (str) => {
1896 var flagModes = {
1897 r: 0,
1898 'r+': 2,
1899 w: 512 | 64 | 1,
1900 'w+': 512 | 64 | 2,
1901 a: 1024 | 64 | 1,
1902 'a+': 1024 | 64 | 2,
1903 };
1904 var flags = flagModes[str];
1905 if (typeof flags == 'undefined') {
1906 throw new Error(`Unknown file open mode: ${str}`);
1907 }
1908 return flags;
1909 };
1910 var FS_getMode = (canRead, canWrite) => {
1911 var mode = 0;
1912 if (canRead) mode |= 292 | 73;

Callers 1

openFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected