DEV Community

221910302029
221910302029

Posted on • Updated on

File Management in java

C Programming - File management in C
In this tutorial you will learn about java Programming - File management in java, File operation functions in java, Defining and opening a file, Closing a file, The getw and putw functions, The fprintf & fscanf functions, Random access to files and fseek function.C supports a number of functions that have the ability to perform basic file operations, which include:1. Naming a file2. Opening a file3. Reading from a file4. Writing data into a file5. Closing a file
•Real life situations involve large volume of data and in such cases, the console oriented I/O operations pose two major problems
•It becomes cumbersome and time consuming to handle large volumes of data through terminals.
•The entire data is lost when either the program is terminated or computer is turned off therefore it is necessary to have more flexible approach where data can be stored on thedisks and read whenever necessary, without destroying the data. This method employs the concept of files to store data.

File operation functions in C:
Function :Name Operation
fopen() :Creates a new file for useOpens a new existing file for use
fclose() : Closes a file which has been opened for
usegetc() :Reads a character from a file
putc() :Writes a character to a file
fprintf() :Writes a set of data values to a file
fscanf() :Reads a set of data values from a file
getw() :Reads a integer from a file
putw() :Writes an integer to the file
fseek() :Sets the position to a desired point in the fileftell() :Gives the current position in the file

Top comments (0)