GeezerVison is showing github.com — doc: numeric flags to fs.open · nodejs/node@615fba3
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/fs.markdown +5Lines changed: 5 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -529,6 +529,11 @@ created. On POSIX systems, `path` is considered to exist even if it is a symlink |
529 | 529 | to a non-existent file. The exclusive flag may or may not work with network file |
530 | 530 | systems. |
531 | 531 |
|
| 532 | +`flags` can also be a number as documented by open(2); commonly used constants |
| 533 | +are available from `require('constants')`. On Windows, flags are translated to |
| 534 | +their equivalent ones where applicable, e.g. `O_WRONLY` to `FILE_GENERIC_WRITE`, |
| 535 | +or `O_EXCL|O_CREAT` to `CREATE_NEW`, as accepted by CreateFileW. |
| 536 | + |
532 | 537 | On Linux, positional writes don't work when the file is opened in append mode. |
533 | 538 | The kernel ignores the position argument and always appends the data to |
534 | 539 | the end of the file. |
|