Hello friends, In this blog post(Types Of File Operations) I am going to explain to you about file operations, as you all know that files are used to store the data information and this information can be retrieved with allowed permission when needed.
Each operating system has a system called to make basic operations on files like the creation of the file, reading from a file, writing to file, etc. The following are some basic operations on the file(Types Of File Operations).
Creating file operations: this operation is used to create a file. It requires two basic steps. first is to find the space for the file in the file system and the next is to make an entry in the directory for this file. This entry includes the name, size, location of the file|Types Of File Operations|
Reading from file operations: The system call that performs the read operation requires two attributes – one is the file name and the other is the block, where information is kept after reading|Types Of File Operations|
Writing to file operations: The system call that performs the write operation into a file requires two attributes – one is the file name in which data is to be written and the other is information that is to be written.
Repositioning within file operations: A file is repositioned from one location to a new location by just reading the file entry in the directory and modifying the location attribute with a new value. This operation does not require actual I/O.
Deleting file operations: In this operation, file entry is erased from the directory and all the space allocated to the file is also released.
Truncating file operations: In this operation, only the contents of files are erased and all other attributes of the file remain unchanged except file size.
Open file operations: Before performing an operation on a file, a process must open it. The purpose of the open file is to permit the system to read the attributes and list of disk addresses into the main memory for rapid access on later calls.
Close file operations: To free the internal table space, when all the accesses have finished, the file should be closed.
Append file operations: This operation is used to add data to the end of the file. Some system that provides a minimal set of system call do not generally have append, but some other systems provide multiple ways of doing the same thing, and this system sometimes has to append.
Seek operations: Seek file operations are used to locate a location where to take the data. One common approach is a system call, which is used to seek the file pointer from a specific place in the file.
Rename operations: Rename operation is used to change the name of the existing file.
Set attributes operations: Some attributes of files are user-settable and can be changed after the file has been created. This system call makes that possible.
Get attributes operations: Get attributes operations are used to return the current value of attributes to the caller program or user.
In the case of any queries, you can write to us at [email protected] we will get back to you ASAP|Types Of File Operations|
Hope! you would have enjoyed this post about types of file operations.
Please feel free to give your important feedback in the comment section below|Types Of File Operations|
Have a great time! Sayonara!