{"action":"created","issue":{"url":"https://api.github.com/repos/jacobwilliams/json-fortran/issues/85","labels_url":"https://api.github.com/repos/jacobwilliams/json-fortran/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/jacobwilliams/json-fortran/issues/85/comments","events_url":"https://api.github.com/repos/jacobwilliams/json-fortran/issues/85/events","html_url":"https://github.com/jacobwilliams/json-fortran/issues/85","id":60853867,"number":85,"title":"0 bad choice for unit number when string is to be used instead of file","user":{"login":"zbeekman","id":279612,"avatar_url":"https://avatars.githubusercontent.com/u/279612?v=3","gravatar_id":"","url":"https://api.github.com/users/zbeekman","html_url":"https://github.com/zbeekman","followers_url":"https://api.github.com/users/zbeekman/followers","following_url":"https://api.github.com/users/zbeekman/following{/other_user}","gists_url":"https://api.github.com/users/zbeekman/gists{/gist_id}","starred_url":"https://api.github.com/users/zbeekman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbeekman/subscriptions","organizations_url":"https://api.github.com/users/zbeekman/orgs","repos_url":"https://api.github.com/users/zbeekman/repos","events_url":"https://api.github.com/users/zbeekman/events{/privacy}","received_events_url":"https://api.github.com/users/zbeekman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-12T17:01:28Z","updated_at":"2015-03-12T17:29:09Z","closed_at":null,"body":"This is bad because for many compilers, 0 is `error_unit` AKA ‘stderr’\r\n\r\nThe safest thing to do would be to code around this completely and rather than detecting a certain unit number either make the unit number optional or add some kind of flag."},"comment":{"url":"https://api.github.com/repos/jacobwilliams/json-fortran/issues/comments/78538407","html_url":"https://github.com/jacobwilliams/json-fortran/issues/85#issuecomment-78538407","issue_url":"https://api.github.com/repos/jacobwilliams/json-fortran/issues/85","id":78538407,"user":{"login":"zbeekman","id":279612,"avatar_url":"https://avatars.githubusercontent.com/u/279612?v=3","gravatar_id":"","url":"https://api.github.com/users/zbeekman","html_url":"https://github.com/zbeekman","followers_url":"https://api.github.com/users/zbeekman/followers","following_url":"https://api.github.com/users/zbeekman/following{/other_user}","gists_url":"https://api.github.com/users/zbeekman/gists{/gist_id}","starred_url":"https://api.github.com/users/zbeekman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbeekman/subscriptions","organizations_url":"https://api.github.com/users/zbeekman/orgs","repos_url":"https://api.github.com/users/zbeekman/repos","events_url":"https://api.github.com/users/zbeekman/events{/privacy}","received_events_url":"https://api.github.com/users/zbeekman/received_events","type":"User","site_admin":false},"created_at":"2015-03-12T17:29:09Z","updated_at":"2015-03-12T17:29:09Z","body":"@szaghi Thanks for the tip, but the issue here is *NOT* finding a new unit. (I actually have some very similar code to yours that that I use in some of my other projects....) This issue is that, currently, json-fortran uses `unit=0` to have a special meaning: operate on a string rather than an external file. The problem with this is that 'stderr' is often connected on 0. If you pass 'ERROR_UNIT' as the unit number to certain json-fortran API calls, this will result in an error, rather than what the user probably intended: printing the json structure to stderr/ERROR_UNIT."}}