In this chapter, we will discuss regarding some of the other functions that are available for files.
|Sr.No.||Functions for Files|
This function returns either the value 1 or the number of lines left to read in an input stream. The filename is given as the input to the function.
This function is used to check the status of a file. Sometimes it is required to check the status of a file before it is used. If the file is corrupt or not available, then no further operations can be performed on the file. So it makes more sense to first check the status of the file.
This function is used to read one character at a time from a file. Sometimes programs require to read files character wise and hence this function can be used for this purpose.
This function returns either 1 or the number of characters left to read in the file itself. The filename is mentioned as a parameter to the function.
This function is used to write one character at a time to a file. The filename is entered as a parameter to the function.