diff --git a/doc/api/fs.md b/doc/api/fs.md index a9abaf2695169e..b6e0004abff744 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1195,8 +1195,8 @@ fs.access(file, fs.constants.F_OK | fs.constants.W_OK, (err) => { }); ``` -Using `fs.access()` to check for the accessibility of a file before calling -`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. Doing +Do not use `fs.access()` to check for the accessibility of a file before calling +`fs.open()`, `fs.readFile()` or `fs.writeFile()`. Doing so introduces a race condition, since other processes may change the file's state between the two calls. Instead, user code should open/read/write the file directly and handle the error raised if the file is not accessible.