| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 49391a7 commit 607b33c
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2008,11 +2008,17 @@ The file is created if it does not exist. | |||
| 2008 | 2008 | ||
| 2009 | 2009 | * `'ax'` - Like `'a'` but fails if `path` exists. | |
| 2010 | 2010 | ||
| 2011 | + * `'as'` - Open file for appending in synchronous mode. | ||
| 2012 | + The file is created if it does not exist. | ||
| 2013 | + | ||
| 2011 | 2014 | * `'a+'` - Open file for reading and appending. | |
| 2012 | 2015 | The file is created if it does not exist. | |
| 2013 | 2016 | ||
| 2014 | 2017 | * `'ax+'` - Like `'a+'` but fails if `path` exists. | |
| 2015 | 2018 | ||
| 2019 | + * `'as+'` - Open file for reading and appending in synchronous mode. | ||
| 2020 | + The file is created if it does not exist. | ||
| 2021 | + | ||
| 2016 | 2022 | `mode` sets the file mode (permission and sticky bits), but only if the file was | |
| 2017 | 2023 | created. It defaults to `0o666` (readable and writable). | |
| 2018 | 2024 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,10 +47,14 @@ function stringToFlags(flags) { | |||
| 47 | 47 | case 'a' : return O_APPEND | O_CREAT | O_WRONLY; | |
| 48 | 48 | case 'ax' : // Fall through. | |
| 49 | 49 | case 'xa' : return O_APPEND | O_CREAT | O_WRONLY | O_EXCL; | |
| 50 | + case 'as' : // Fall through. | ||
| 51 | + case 'sa' : return O_APPEND | O_CREAT | O_WRONLY | O_SYNC; | ||
| 50 | 52 | ||
| 51 | 53 | case 'a+' : return O_APPEND | O_CREAT | O_RDWR; | |
| 52 | 54 | case 'ax+': // Fall through. | |
| 53 | 55 | case 'xa+': return O_APPEND | O_CREAT | O_RDWR | O_EXCL; | |
| 56 | + case 'as+': // Fall through. | ||
| 57 | + case 'sa+': return O_APPEND | O_CREAT | O_RDWR | O_SYNC; | ||
| 54 | 58 | } | |
| 55 | 59 | ||
| 56 | 60 | throw new errors.TypeError('ERR_INVALID_OPT_VALUE', 'flags', flags); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -56,8 +56,12 @@ assert.strictEqual(stringToFlags('wx+'), O_TRUNC | O_CREAT | O_RDWR | O_EXCL); | |||
| 56 | 56 | assert.strictEqual(stringToFlags('xw+'), O_TRUNC | O_CREAT | O_RDWR | O_EXCL); | |
| 57 | 57 | assert.strictEqual(stringToFlags('ax'), O_APPEND | O_CREAT | O_WRONLY | O_EXCL); | |
| 58 | 58 | assert.strictEqual(stringToFlags('xa'), O_APPEND | O_CREAT | O_WRONLY | O_EXCL); | |
| 59 | + assert.strictEqual(stringToFlags('as'), O_APPEND | O_CREAT | O_WRONLY | O_SYNC); | ||
| 60 | + assert.strictEqual(stringToFlags('sa'), O_APPEND | O_CREAT | O_WRONLY | O_SYNC); | ||
| 59 | 61 | assert.strictEqual(stringToFlags('ax+'), O_APPEND | O_CREAT | O_RDWR | O_EXCL); | |
| 60 | 62 | assert.strictEqual(stringToFlags('xa+'), O_APPEND | O_CREAT | O_RDWR | O_EXCL); | |
| 63 | + assert.strictEqual(stringToFlags('as+'), O_APPEND | O_CREAT | O_RDWR | O_SYNC); | ||
| 64 | + assert.strictEqual(stringToFlags('sa+'), O_APPEND | O_CREAT | O_RDWR | O_SYNC); | ||
| 61 | 65 | ||
| 62 | 66 | ('+ +a +r +w rw wa war raw r++ a++ w++ x +x x+ rx rx+ wxx wax xwx xxx') | |
| 63 | 67 | .split(' ') | |
| Back | FazBrowse Home | New Git URL |
0 commit comments