From b10433bf725983c91027b4b1172f25968e29dbe4 Mon Sep 17 00:00:00 2001 From: Carl Lei Date: Tue, 3 Nov 2015 09:53:59 +0800 Subject: [PATCH] doc: numeric flags to fs.open This has been supperted for long but never tested nor documented. PR-URL: https://github.com/nodejs/node/pull/3641 Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell --- doc/api/fs.markdown | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown index aa33039..97903db 100644 --- a/doc/api/fs.markdown +++ b/doc/api/fs.markdown @@ -529,6 +529,11 @@ created. On POSIX systems, `path` is considered to exist even if it is a symlink to a non-existent file. The exclusive flag may or may not work with network file systems. +`flags` can also be a number as documented by open(2); commonly used constants +are available from `require('constants')`. On Windows, flags are translated to +their equivalent ones where applicable, e.g. `O_WRONLY` to `FILE_GENERIC_WRITE`, +or `O_EXCL|O_CREAT` to `CREATE_NEW`, as accepted by CreateFileW. + On Linux, positional writes don't work when the file is opened in append mode. The kernel ignores the position argument and always appends the data to the end of the file. -- 2.7.4