GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: clarify that fs.exists() may return false for existing symlink · nodejs/node@c6166cd

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • fs.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/fs.md‎

Copy file name to clipboardExpand all lines: doc/api/fs.md
+4-1Lines changed: 4 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2736,7 +2736,7 @@ changes:
27362736
* `callback` {Function}
27372737
* `exists` {boolean}
27382738
2739-
Test whether or not the given path exists by checking with the file system.
2739+
Test whether or not the element at the given `path` exists by checking with the file system.
27402740
Then call the `callback` argument with either true or false:
27412741
27422742
```mjs
@@ -2753,6 +2753,9 @@ parameter, optionally followed by other parameters. The `fs.exists()` callback
27532753
has only one boolean parameter. This is one reason `fs.access()` is recommended
27542754
instead of `fs.exists()`.
27552755
2756+
If `path` is a symbolic link, it is followed. Thus, if `path` exists but points
2757+
to a non-existent element, the callback will receive the value `false`.
2758+
27562759
Using `fs.exists()` to check for the existence of a file before calling
27572760
`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing
27582761
so introduces a race condition, since other processes may change the file's

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.