It reads at most maxlength characters into s, stopping when the terminator is read, and pushing the terminator back into the input stream. Both call stdio ungetc . File Control flush , seek , tell , and tell call the corresponding stdio functions. While intermixing File and system IO calls is not at all recommended, this technique does allow the File class to be used in conjunction with other functions and libraries already set up to operate on file descriptors. File Status File status is maintained in several ways.
Errors occuring during constructors and file opens also invoke the function error .
Since error cannot tell if the current system error is actually responsible for a failure, it may at times print out spurious messages. Three error handlers are provided. C programmers who are unfamiliar with these conventions should note that, unlike the stdio library, File functions indicate IO success, status, or failure solely through the state, not via return values of the functions. If the file is being used mainly for random access, it is often a good idea to eliminate internal buffering via setbuf or raw . Go to the previous , next section.