| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ae86adc commit 5e90fc6
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -323,12 +323,7 @@ fs.accessSync = function(path, mode) { | |||
| 323 | 323 | }; | |
| 324 | 324 | ||
| 325 | 325 | fs.exists = function(path, callback) { | |
| 326 | - if (handleError((path = getPathFromURL(path)), cb)) | ||
| 327 | - return; | ||
| 328 | - if (!nullCheck(path, cb)) return; | ||
| 329 | - var req = new FSReqWrap(); | ||
| 330 | - req.oncomplete = cb; | ||
| 331 | - binding.stat(pathModule.toNamespacedPath(path), req); | ||
| 326 | + fs.access(path, fs.F_OK, cb); | ||
| 332 | 327 | function cb(err) { | |
| 333 | 328 | if (callback) callback(err ? false : true); | |
| 334 | 329 | } | |
@@ -345,9 +340,7 @@ Object.defineProperty(fs.exists, internalUtil.promisify.custom, { | |||
| 345 | 340 | ||
| 346 | 341 | fs.existsSync = function(path) { | |
| 347 | 342 | try { | |
| 348 | - handleError((path = getPathFromURL(path))); | ||
| 349 | - nullCheck(path); | ||
| 350 | - binding.stat(pathModule.toNamespacedPath(path)); | ||
| 343 | + fs.accessSync(path, fs.F_OK); | ||
| 351 | 344 | return true; | |
| 352 | 345 | } catch (e) { | |
| 353 | 346 | return false; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments