{"action":"opened","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/9687","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/9687/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/9687/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/9687/events","html_url":"https://github.com/JuliaLang/julia/issues/9687","id":53836540,"number":9687,"title":"Inconsistent behaviour of readbytes","user":{"login":"amitmurthy","id":117461,"avatar_url":"https://avatars.githubusercontent.com/u/117461?v=3","gravatar_id":"","url":"https://api.github.com/users/amitmurthy","html_url":"https://github.com/amitmurthy","followers_url":"https://api.github.com/users/amitmurthy/followers","following_url":"https://api.github.com/users/amitmurthy/following{/other_user}","gists_url":"https://api.github.com/users/amitmurthy/gists{/gist_id}","starred_url":"https://api.github.com/users/amitmurthy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amitmurthy/subscriptions","organizations_url":"https://api.github.com/users/amitmurthy/orgs","repos_url":"https://api.github.com/users/amitmurthy/repos","events_url":"https://api.github.com/users/amitmurthy/events{/privacy}","received_events_url":"https://api.github.com/users/amitmurthy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/bug","name":"bug","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-09T06:01:21Z","updated_at":"2015-01-09T06:01:21Z","closed_at":null,"body":"`readbytes(s, 1)` and `readbytes(s)` behave differently w.r.t. `eof`\r\n\r\n```\r\njulia> w=open(\"/tmp/x.txt\", \"a\")\r\nIOStream(<file /tmp/x.txt>)\r\n\r\njulia> io=open(\"/tmp/x.txt\")\r\nIOStream(<file /tmp/x.txt>)\r\n\r\njulia> write(w, \"A\"); flush(w);\r\n\r\njulia> readbytes(io, 1)\r\n1-element Array{UInt8,1}:\r\n 0x41\r\n\r\njulia> readbytes(io, 1)\r\n0-element Array{UInt8,1}\r\n\r\njulia> write(w, \"A\"); flush(w);\r\n\r\njulia> readbytes(io, 1)\r\n1-element Array{UInt8,1}:\r\n 0x41\r\n\r\njulia> readbytes(io, 1)\r\n0-element Array{UInt8,1}\r\n\r\njulia> write(w, \"A\"); flush(w);\r\n\r\njulia> readbytes(io)\r\n1-element Array{UInt8,1}:\r\n 0x41\r\n\r\njulia> readbytes(io)\r\n0-element Array{UInt8,1}\r\n\r\njulia> write(w, \"A\"); flush(w);\r\n\r\njulia> readbytes(io)\r\n0-element Array{UInt8,1}\r\n\r\n```\r\n\r\nAs can been seen, with `readbytes(io, 1)` , any new bytes that are appended to the file are read, but not so once we call `readbytes(io)`. \r\n\r\n\r\n"}}