0% found this document useful (0 votes)
23 views4 pages

File Operations:: Create

The document outlines essential file operations such as creating, opening, reading, writing, closing, deleting, and seeking files, which are crucial for managing files in an operating system. It also details file attributes, including file name, extension, type, permissions, timestamps, and read-only flags, which provide metadata for file management. Additionally, the document explains the file structure and organization within a file system, emphasizing the layered approach used by operating systems to efficiently store, locate, and retrieve files.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views4 pages

File Operations:: Create

The document outlines essential file operations such as creating, opening, reading, writing, closing, deleting, and seeking files, which are crucial for managing files in an operating system. It also details file attributes, including file name, extension, type, permissions, timestamps, and read-only flags, which provide metadata for file management. Additionally, the document explains the file structure and organization within a file system, emphasizing the layered approach used by operating systems to efficiently store, locate, and retrieve files.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

File Operations:

File operations are key operating system functions for successfully managing files. Users and
applications can utilize these activities to interact with files, read and write data, create new
files, and execute different operations on existing files. Understanding file operations is essential
for managing files in any operating system.

o Create: The create function enables users and programs to generate new files in the file
system. When a new file is created, it begins empty, and the operating system assigns it
a distinctive file name, along with attributes such as permissions, timestamps, and file
size.

o Open: The open function is a crucial feature that enables users and applications to
access files stored in the file system. When you open a file, it establishes a connection
between the file and the application, allowing the application to interact with the file by
either reading or writing data. This functionality serves as a fundamental mechanism for
managing and manipulating files within computer systems.

o Read: An application can use the read action to read the contents of a file. When a file is
opened for reading, the operating system grants the application access to the data
within the file. After that, the application can process or display this data.

o Write: The write action in programming enables an application to make changes to a


file. When a file is opened for writing, the application can add, modify, or replace data.
In a file, write operation can be done at any position within the file or by appending data
at the end.

o Close: Closing a file in an application marks the end of communication between them.
When a file is closed, any changes made by the application are usually saved, and the file
becomes accessible for use by other applications.

o Delete: Users and applications can use the delete function to remove files from the file
system and free up disk space. This action permanently erases the file, making its
contents inaccessible.

o Seek: The seek action allows users or apps to move the read/write location within a file.
The program can direct the read/write pointer to a specified location in the file by
specifying an offset from the beginning, end, or current position.

File Attributes:
File attributes refer to the metadata associated with files in the file system. They provide
comprehensive information beyond names and contents. Operating systems utilize these
attributes to store crucial details like permissions, timestamps, file types, and ownerships.
Understanding file properties is vital for effectively controlling and limiting access to files.

o File Name: The file name is a crucial element that uniquely identifies a file within its
directory. It serves to refer to the file and locate it in the file system. File names often
adhere to specific standards and norms set by operating systems, including regulations
regarding length and permissible characters.

o Extension: The file extension is a file name component that appears after the last
period ('.') and specifies the file's type or format. It helps the operating system and other
applications recognize and handle file information. For example, a ".txt" file is frequently
called a plain text file.

o File Type: The file type attribute specifies the file's content category or format. The
general file types include text, photographs(images), audio files, videos, and any
executable programs.

o File Permissions: With this feature, we can control all the files present in the system by
defining who can access which files and the access controls they have, thus avoiding
unauthorized access and protecting the information. These permissions include which
user can read, write, or append to the existing files. Permissions often represent access
privileges for the file owner, the group, and others (non-group or owner users). Common
permissions include read (r), write (w), and execute (x).

o Timestamps: Files contain three major timestamps that indicate when they
were created, modified, and accessed.

o Read-Only Flag: Some operating systems allow you to mark files as read-only and
disable any edits or writes to the file while still allowing read access. It can be beneficial
for safeguarding crucial files against unauthorized changes.

o Direct access allows you to read or write data anywhere in the file without sequentially
traversing the entire file.

o The file system uses an offset or address to reach a certain point, which precisely places
the contents within the file. This strategy is more efficient for large files since it allows
quick access to certain data points without reading unnecessary parts of the
file. Random access is useful for applications that require frequent or non-sequential
data access, such as databases or indexed file systems.

o Full Backup: A full backup copies all files and data at a specific time. It provides the most
extensive and isolated backup but is time-consuming and consumes significant storage
space.
File Structure:
File System provide efficient access to the disk by allowing data to be stored,
located and retrieved in a convenient way. A file System must be able to store the
file, locate the file and retrieve the file.

Most of the Operating Systems use layering approach for every task including file
systems. Every layer of the file system is responsible for some activiti
o When an application program asks for a file, the first request is directed to the logical file
system. The logical file system contains the Meta data of the file and directory structure.
If the application program doesn't have the required permissions of the file then this
layer will throw an error. Logical file systems also verify the path to the file.

o Generally, files are divided into various logical blocks. Files are to be stored in the hard
disk and to be retrieved from the hard disk. Hard disk is divided into various tracks and
sectors. Therefore, in order to store and retrieve the files, the logical blocks need to be
mapped to physical blocks. This mapping is done by File organization module. It is also
responsible for free space management.

o Once File organization module decided which physical block the application program
needs, it passes this information to basic file system. The basic file system is responsible
for issuing the commands to I/O control in order to fetch those blocks.

o I/O controls contain the codes by using which it can access hard disk. These codes are
known as device drivers. I/O controls are also responsible for handling interrupts.

You might also like