id,summary,reporter,owner,description,type,status,priority,component,version,resolution,keywords,cc,game 1807,ALL: Bug in File class,sev-,sev-,"{{{#!Markdown There is a bug in file class which prevents eof\(\) method from working. As I don't understand reason for particular code line, I post it here, though I suspect it's some kind of copy'n'paste error. The problem is in this chunk: real\_len = fread\(ptr2, 1, len, \_handle\); if \(real\_len < len\) \{ clearerr\(\_handle\); // <- clears eof status \_ioFailed = true; \} line with comment on it prevents eof\(\) from reporting. And simple loop like this: File in; in.open\(""blah""\); while\(\!in.eof\(\)\) \{ in.read\(&buf, 1\); \} will never end. Same thing is in write\(\) method, which may trigger similiar bug as well. What's the reason of clearing error of \_handle? Could that be removed? If it has to be there, then something like this should be added: if \(real\_len < len\) \{ \_eof = feof\(\_handle\) \!= 0; clearerr\(\_handle\); \_ioFailed = true; \} and then remove that \_eof in eof\(\) method. }}} {{{#!div style=""font-size: 75%"" Ticket imported from: !#1048129. Ticket imported from: bugs/1807. }}}",defect,closed,high,--Other--,,fixed,,,