{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/166625710","pull_request_review_id":94717978,"id":166625710,"diff_hunk":"@@ -411,13 +411,7 @@ fs.accessSync = function(path, mode) {\n };\n \n fs.exists = function(path, callback) {\n-  if (handleError((path = getPathFromURL(path)), cb))\n-    return;\n-  validatePath(path);\n-  if (!nullCheck(path, cb)) return;\n-  var req = new FSReqWrap();\n-  req.oncomplete = cb;\n-  binding.stat(pathModule.toNamespacedPath(path), req);\n+  fs.access(path, fs.F_OK, cb);","path":"lib/fs.js","position":11,"original_position":11,"commit_id":"6c9658ec3b6f03f63f3bcb3dd86d19b88a093dee","original_commit_id":"6c9658ec3b6f03f63f3bcb3dd86d19b88a093dee","user":{"login":"richardlau","id":5445507,"avatar_url":"https://avatars0.githubusercontent.com/u/5445507?v=4","gravatar_id":"","url":"https://api.github.com/users/richardlau","html_url":"https://github.com/richardlau","followers_url":"https://api.github.com/users/richardlau/followers","following_url":"https://api.github.com/users/richardlau/following{/other_user}","gists_url":"https://api.github.com/users/richardlau/gists{/gist_id}","starred_url":"https://api.github.com/users/richardlau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardlau/subscriptions","organizations_url":"https://api.github.com/users/richardlau/orgs","repos_url":"https://api.github.com/users/richardlau/repos","events_url":"https://api.github.com/users/richardlau/events{/privacy}","received_events_url":"https://api.github.com/users/richardlau/received_events","type":"User","site_admin":false},"body":"Is the behavior of `fs.exists` altered if callback is not a function? It looks like `fs.access` throws a TypeError in that case.","created_at":"2018-02-07T14:05:06Z","updated_at":"2018-02-07T14:05:06Z","html_url":"https://github.com/nodejs/node/pull/18618#discussion_r166625710","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/18618","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/166625710"},"html":{"href":"https://github.com/nodejs/node/pull/18618#discussion_r166625710"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/18618"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/18618","id":167671883,"html_url":"https://github.com/nodejs/node/pull/18618","diff_url":"https://github.com/nodejs/node/pull/18618.diff","patch_url":"https://github.com/nodejs/node/pull/18618.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/18618","number":18618,"state":"open","locked":false,"title":"fs: use fs.access in fs.exists","user":{"login":"bzoz","id":17704638,"avatar_url":"https://avatars2.githubusercontent.com/u/17704638?v=4","gravatar_id":"","url":"https://api.github.com/users/bzoz","html_url":"https://github.com/bzoz","followers_url":"https://api.github.com/users/bzoz/followers","following_url":"https://api.github.com/users/bzoz/following{/other_user}","gists_url":"https://api.github.com/users/bzoz/gists{/gist_id}","starred_url":"https://api.github.com/users/bzoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bzoz/subscriptions","organizations_url":"https://api.github.com/users/bzoz/orgs","repos_url":"https://api.github.com/users/bzoz/repos","events_url":"https://api.github.com/users/bzoz/events{/privacy}","received_events_url":"https://api.github.com/users/bzoz/received_events","type":"User","site_admin":false},"body":"Uses `fs.access()` to implement `fs.exists()` functionality. Fixes a issue, when a file exists but user does not have privileges to do stat on the file. \r\n\r\nFixes: https://github.com/nodejs/node/issues/17921\r\n\r\n<!--\r\nThank you for your pull request. Please provide a description above and review\r\nthe requirements below.\r\n\r\nBug fixes and new features should include tests and possibly benchmarks.\r\n\r\nContributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md\r\n-->\r\n\r\n##### Checklist\r\n<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->\r\n\r\n- [x] `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes\r\n- [x] commit message follows [commit guidelines](https://github.com/nodejs/node/blob/master/doc/guides/contributing/pull-requests.md#commit-message-guidelines)\r\n\r\n##### Affected core subsystem(s)\r\n<!-- Provide affected core subsystem(s) (like doc, cluster, crypto, etc). -->\r\nfs","created_at":"2018-02-07T11:52:20Z","updated_at":"2018-02-07T14:05:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"878471fc4105728102834de87954be75f043d936","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/18618/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/18618/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/18618/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/6c9658ec3b6f03f63f3bcb3dd86d19b88a093dee","head":{"label":"janeasystems:bartek-exists-as-access","ref":"bartek-exists-as-access","sha":"6c9658ec3b6f03f63f3bcb3dd86d19b88a093dee","user":{"login":"janeasystems","id":9194778,"avatar_url":"https://avatars2.githubusercontent.com/u/9194778?v=4","gravatar_id":"","url":"https://api.github.com/users/janeasystems","html_url":"https://github.com/janeasystems","followers_url":"https://api.github.com/users/janeasystems/followers","following_url":"https://api.github.com/users/janeasystems/following{/other_user}","gists_url":"https://api.github.com/users/janeasystems/gists{/gist_id}","starred_url":"https://api.github.com/users/janeasystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janeasystems/subscriptions","organizations_url":"https://api.github.com/users/janeasystems/orgs","repos_url":"https://api.github.com/users/janeasystems/repos","events_url":"https://api.github.com/users/janeasystems/events{/privacy}","received_events_url":"https://api.github.com/users/janeasystems/received_events","type":"Organization","site_admin":false},"repo":{"id":36501512,"name":"node","full_name":"janeasystems/node","owner":{"login":"janeasystems","id":9194778,"avatar_url":"https://avatars2.githubusercontent.com/u/9194778?v=4","gravatar_id":"","url":"https://api.github.com/users/janeasystems","html_url":"https://github.com/janeasystems","followers_url":"https://api.github.com/users/janeasystems/followers","following_url":"https://api.github.com/users/janeasystems/following{/other_user}","gists_url":"https://api.github.com/users/janeasystems/gists{/gist_id}","starred_url":"https://api.github.com/users/janeasystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janeasystems/subscriptions","organizations_url":"https://api.github.com/users/janeasystems/orgs","repos_url":"https://api.github.com/users/janeasystems/repos","events_url":"https://api.github.com/users/janeasystems/events{/privacy}","received_events_url":"https://api.github.com/users/janeasystems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/janeasystems/node","description":"Node.js, but with bigger and faster version numbers","fork":true,"url":"https://api.github.com/repos/janeasystems/node","forks_url":"https://api.github.com/repos/janeasystems/node/forks","keys_url":"https://api.github.com/repos/janeasystems/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/janeasystems/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/janeasystems/node/teams","hooks_url":"https://api.github.com/repos/janeasystems/node/hooks","issue_events_url":"https://api.github.com/repos/janeasystems/node/issues/events{/number}","events_url":"https://api.github.com/repos/janeasystems/node/events","assignees_url":"https://api.github.com/repos/janeasystems/node/assignees{/user}","branches_url":"https://api.github.com/repos/janeasystems/node/branches{/branch}","tags_url":"https://api.github.com/repos/janeasystems/node/tags","blobs_url":"https://api.github.com/repos/janeasystems/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/janeasystems/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/janeasystems/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/janeasystems/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/janeasystems/node/statuses/{sha}","languages_url":"https://api.github.com/repos/janeasystems/node/languages","stargazers_url":"https://api.github.com/repos/janeasystems/node/stargazers","contributors_url":"https://api.github.com/repos/janeasystems/node/contributors","subscribers_url":"https://api.github.com/repos/janeasystems/node/subscribers","subscription_url":"https://api.github.com/repos/janeasystems/node/subscription","commits_url":"https://api.github.com/repos/janeasystems/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/janeasystems/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/janeasystems/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/janeasystems/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/janeasystems/node/contents/{+path}","compare_url":"https://api.github.com/repos/janeasystems/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/janeasystems/node/merges","archive_url":"https://api.github.com/repos/janeasystems/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/janeasystems/node/downloads","issues_url":"https://api.github.com/repos/janeasystems/node/issues{/number}","pulls_url":"https://api.github.com/repos/janeasystems/node/pulls{/number}","milestones_url":"https://api.github.com/repos/janeasystems/node/milestones{/number}","notifications_url":"https://api.github.com/repos/janeasystems/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/janeasystems/node/labels{/name}","releases_url":"https://api.github.com/repos/janeasystems/node/releases{/id}","deployments_url":"https://api.github.com/repos/janeasystems/node/deployments","created_at":"2015-05-29T11:56:02Z","updated_at":"2016-10-26T22:21:34Z","pushed_at":"2018-02-07T09:40:23Z","git_url":"git://github.com/janeasystems/node.git","ssh_url":"git@github.com:janeasystems/node.git","clone_url":"https://github.com/janeasystems/node.git","svn_url":"https://github.com/janeasystems/node","homepage":"https://iojs.org","size":341521,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"nodejs:master","ref":"master","sha":"c0762c2f54f80b92f2f5e0f9af51f4c048c53e4f","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars3.githubusercontent.com/u/9950313?v=4","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"name":"node","full_name":"nodejs/node","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars3.githubusercontent.com/u/9950313?v=4","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":false,"url":"https://api.github.com/repos/nodejs/node","forks_url":"https://api.github.com/repos/nodejs/node/forks","keys_url":"https://api.github.com/repos/nodejs/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/node/teams","hooks_url":"https://api.github.com/repos/nodejs/node/hooks","issue_events_url":"https://api.github.com/repos/nodejs/node/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/node/events","assignees_url":"https://api.github.com/repos/nodejs/node/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/node/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/node/tags","blobs_url":"https://api.github.com/repos/nodejs/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/node/languages","stargazers_url":"https://api.github.com/repos/nodejs/node/stargazers","contributors_url":"https://api.github.com/repos/nodejs/node/contributors","subscribers_url":"https://api.github.com/repos/nodejs/node/subscribers","subscription_url":"https://api.github.com/repos/nodejs/node/subscription","commits_url":"https://api.github.com/repos/nodejs/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/node/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/node/merges","archive_url":"https://api.github.com/repos/nodejs/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/node/downloads","issues_url":"https://api.github.com/repos/nodejs/node/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/node/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/node/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/node/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/node/releases{/id}","deployments_url":"https://api.github.com/repos/nodejs/node/deployments","created_at":"2014-11-26T19:57:11Z","updated_at":"2018-02-07T13:01:52Z","pushed_at":"2018-02-07T14:02:30Z","git_url":"git://github.com/nodejs/node.git","ssh_url":"git@github.com:nodejs/node.git","clone_url":"https://github.com/nodejs/node.git","svn_url":"https://github.com/nodejs/node","homepage":"https://nodejs.org","size":349889,"stargazers_count":45286,"watchers_count":45286,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9494,"mirror_url":null,"archived":false,"open_issues_count":780,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":9494,"open_issues":780,"watchers":45286,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/18618"},"html":{"href":"https://github.com/nodejs/node/pull/18618"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/18618"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/18618/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/18618/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/18618/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/6c9658ec3b6f03f63f3bcb3dd86d19b88a093dee"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"richardlau"}}