diff --git a/doc/api/fs.md b/doc/api/fs.md index 4364b1cc5c..1d64f73633 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -795,6 +795,23 @@ 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. +_Note: The behavior of `fs.open()` is platform specific for some flags. As such, +opening a directory on OS X and Linux with the `'a+'` flag - see example below - +will return an error. Whereas on Windows and FreeBSD a file descriptor will be +returned._ + +```js +// OS X and Linux +fs.open('', 'a+', (err, fd) => { + // => [Error: EISDIR: illegal operation on a directory, open ] +}) + +// Windows and FreeBSD +fs.open('', 'a+', (err, fd) => { + // => null, +}) +``` + ## fs.openSync(path, flags[, mode]) * `path` {String | Buffer}