{"action":"created","issue":{"url":"https://api.github.com/repos/mikeizbicki/ucr-cs100/issues/1088","labels_url":"https://api.github.com/repos/mikeizbicki/ucr-cs100/issues/1088/labels{/name}","comments_url":"https://api.github.com/repos/mikeizbicki/ucr-cs100/issues/1088/comments","events_url":"https://api.github.com/repos/mikeizbicki/ucr-cs100/issues/1088/events","html_url":"https://github.com/mikeizbicki/ucr-cs100/issues/1088","id":60225000,"number":1088,"title":"getcwd vs. $PWD?","user":{"login":"scohe001","id":5588237,"avatar_url":"https://avatars.githubusercontent.com/u/5588237?v=3","gravatar_id":"","url":"https://api.github.com/users/scohe001","html_url":"https://github.com/scohe001","followers_url":"https://api.github.com/users/scohe001/followers","following_url":"https://api.github.com/users/scohe001/following{/other_user}","gists_url":"https://api.github.com/users/scohe001/gists{/gist_id}","starred_url":"https://api.github.com/users/scohe001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scohe001/subscriptions","organizations_url":"https://api.github.com/users/scohe001/orgs","repos_url":"https://api.github.com/users/scohe001/repos","events_url":"https://api.github.com/users/scohe001/events{/privacy}","received_events_url":"https://api.github.com/users/scohe001/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mikeizbicki/ucr-cs100/labels/great%20question","name":"great question","color":"fef2c0"},{"url":"https://api.github.com/repos/mikeizbicki/ucr-cs100/labels/hw3","name":"hw3","color":"fbca04"},{"url":"https://api.github.com/repos/mikeizbicki/ucr-cs100/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-07T21:19:17Z","updated_at":"2015-03-08T18:42:35Z","closed_at":null,"body":"It seems to me that to find the current working directory for the prompt we could either call `getcwd` or use `getenv` to fetch the `PWD` environment variable storing the same information...is there any obvious reason to use one over the other?\r\n\r\nI'm tempted to use `getenv` only because the memory for the string has already been allocated and we don't have to worry about the deallocation, whereas with `getcwd` to ensure we can handle any path length, we'll have to ask `getcwd` to allocate new memory for us.\r\n\r\nAm I missing anything?"},"comment":{"url":"https://api.github.com/repos/mikeizbicki/ucr-cs100/issues/comments/77766775","html_url":"https://github.com/mikeizbicki/ucr-cs100/issues/1088#issuecomment-77766775","issue_url":"https://api.github.com/repos/mikeizbicki/ucr-cs100/issues/1088","id":77766775,"user":{"login":"eneva002","id":5578404,"avatar_url":"https://avatars.githubusercontent.com/u/5578404?v=3","gravatar_id":"","url":"https://api.github.com/users/eneva002","html_url":"https://github.com/eneva002","followers_url":"https://api.github.com/users/eneva002/followers","following_url":"https://api.github.com/users/eneva002/following{/other_user}","gists_url":"https://api.github.com/users/eneva002/gists{/gist_id}","starred_url":"https://api.github.com/users/eneva002/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eneva002/subscriptions","organizations_url":"https://api.github.com/users/eneva002/orgs","repos_url":"https://api.github.com/users/eneva002/repos","events_url":"https://api.github.com/users/eneva002/events{/privacy}","received_events_url":"https://api.github.com/users/eneva002/received_events","type":"User","site_admin":false},"created_at":"2015-03-08T18:42:35Z","updated_at":"2015-03-08T18:42:35Z","body":"PWD doesn't reflect any chdir calls you may make\n\nThanks,\n\nEmil Nevarez\nOn Mar 7, 2015 1:19 PM, \"scohe001\" <notifications@github.com> wrote:\n\n> It seems to me that to find the current working directory for the prompt\n> we could either either call getcwd or use getenv to fetch the PWD\n> environment variable storing the same information...is there any obvious\n> reason to use one over the other?\n>\n> I'm tempted to use getenv only because the memory for the string has\n> already been allocated and we don't have to worry about the deallocation,\n> whereas with getcwd to ensure we can handle any path length, we'll have\n> to ask getcwed to allocate new memory for us.\n>\n> Am I missing anything?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/mikeizbicki/ucr-cs100/issues/1088>.\n>\n"}}