| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bcd08be commit 73860ac
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2656,7 +2656,7 @@ changes: | |||
| 2656 | 2656 | * `callback` {Function} | |
| 2657 | 2657 | * `exists` {boolean} | |
| 2658 | 2658 | ||
| 2659 | - Test whether or not the given path exists by checking with the file system. | ||
| 2659 | + Test whether or not the element at the given `path` exists by checking with the file system. | ||
| 2660 | 2660 | Then call the `callback` argument with either true or false: | |
| 2661 | 2661 | ||
| 2662 | 2662 | ```mjs | |
@@ -2673,6 +2673,9 @@ parameter, optionally followed by other parameters. The `fs.exists()` callback | |||
| 2673 | 2673 | has only one boolean parameter. This is one reason `fs.access()` is recommended | |
| 2674 | 2674 | instead of `fs.exists()`. | |
| 2675 | 2675 | ||
| 2676 | + If `path` is a symbolic link, it is followed. Thus, if `path` exists but points | ||
| 2677 | + to a non-existent element, the callback will receive the value `false`. | ||
| 2678 | + | ||
| 2676 | 2679 | Using `fs.exists()` to check for the existence of a file before calling | |
| 2677 | 2680 | `fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing | |
| 2678 | 2681 | so introduces a race condition, since other processes may change the file's | |
| Back | FazBrowse Home | New Git URL |
0 commit comments