Sunteți pe pagina 1din 4

OPERSYS (Operating Systems)

BS Information Technology 3A

File Management

File management deals with:

How files and directories are named?


How files and directories are accessed or used?
What operations can be performed on files and directories
How files and directories are protected?
How files and directories are structured?
How files and directories are implemented?

File(s)

• It is a collection of related information or data that is stored together in secondary


storage for future use.

Common information kept about files:

1. Filename - Each file has a unique, symbolic filename which allows users to differentiate
one file from another.

2. File ID – The operating system actually uses file identifiers or file ID’s to distinguish files from
one another. A file ID is a unique number assigned to a file. It is used by the OS in
manipulating files.

3. File Size – This indicates the actual size of the file commonly expressed in bytes or
kilobytes. The size of a file may also be given in terms of the number block or sectors it
occupies when stored in a secondary device like the hard disk.

4. File Type – this indicates what kind of file it is (whether it is an executable file, a text file, a
library file, etc.)

5. File Date/Time – this includes information such as the date and time the file was created,
last modified, last accessed, last backed-up, etc.

6. File Location – this contains information on which storage device and the exact location
within that device the file is stored.

7. File Protected – this contains access-control information about the file. It indicates which
user or process has read-write access or read-only access. If the file is a program, this
information indicates if a user executes it or not.

8. File Attribute Flags – these are flags or bits that contain additional information about a
file. Common attribute flags are:

a. Hidden Flag – this flag is a 1 if the file is hidden file. Hidden files are not shown
when a list of files is requested by a user.

Introduction to File Management – Finals Page 1 of 4


OPERSYS (Operating Systems)
BS Information Technology 3A

b. System Flag – this flag or bit is a 1 if a file is an operating system file. It is a 0 for
normal or ordinary files. Like hidden files, system files are usually not shown when a
list of file is requested by a user. In addition, system files cannot be simply copied
and deleted by the users.

c. Archive Flag – this flag or bit is 1 if the file needs to be backed-up.

d. Read-Only Flag – this flag or bit is a 1 if the file is for read-only access

File Operations

1. Create – the operation facilitates the creation of a new file.

2. Delete – this operation allows the deletion of files that are no longer needed in order to
free up more space in secondary storage.

3. Open – before the file can be read or modified, it has to be open first.

4. Close – once a file is closed, the attributes and disk location of the file that were loaded
into the main memory when it was opened are deleted.

5. Rename – this operation allows the name of the file to be modified.

6. Copy – this operation copies the contents of one file into another, thereby creating a
duplicate of that file.

7. Get Attribute – this operation allows a user or a process to read the attributes of a file.

8. Set Attribute - this operation allows a user to modify the attribute of a file.

9. List – this operation prints or displays the contents of a file.

10. Read – this operation copies the contents of the file to the main memory. The data
copied can then be processed by the requesting user or process.

11. Modify or Write – this operation copies the data stored in main memory to a file.

12. Append – this is a special kind of write operation wherein data can only be added at the
end of a file.

Directories/Folders

A directory contains files that are related to one another

Operations that can be performed on directories.

1. Search – the operation allows a user or a process to search a directory for a specific file.

Introduction to File Management – Finals Page 2 of 4


OPERSYS (Operating Systems)
BS Information Technology 3A

2. Create a file – when a file is created, the operation allows that file to be included or
added in a directory.

3. Delete a file – when a file is deleted, the operation removes the file in a directory.

4. Rename a file – when a file is renamed, this operation will also renames its entry in a
directory.

5. List – this operation displays all the files included in a directory.

6. Traverse a File System – this system allows a user to move to different directories within
the file system.

Directory Structure

1. Single-Level Directory Structure

✓ Entire file system has only one directory and all files are stored in that directory.

✓ This directory is sometimes called the root directory.

✓ It is also called a flat file system

2. Hierarchical Directory Structure

✓ Aside from files, a directory may also contain subdirectories and subdirectories
may contain other subdirectories.

✓ It is also called tree structure

3. Acyclic Directory Structure

✓ Similar to the hierarchical structure except that a file or a directory may be


shared by several directories.

File Allocation Methods

1. Contiguous Allocation

Operating system stores a file using contiguous or consecutive blocks in the hard
disk.

2. Linked Allocation

File is implemented as a linked list of disk blocks.

3. Clustering

Several contiguous blocks are grouped together in clusters.

Introduction to File Management – Finals Page 3 of 4


OPERSYS (Operating Systems)
BS Information Technology 3A

4. Indexed Allocation

Pointers for the blocks of a particular file are stored in a single block called the
index block

Free Space Management

There are basically two methods that are widely used in the implementation of the free-space
list:

A. Grouping Method

Free-space list is implemented as a linked list of specially-designated disk blocks.

B. Bit map Method

A string of bits is used to indicate whether a particular disk block is free or not.

Introduction to File Management – Finals Page 4 of 4

S-ar putea să vă placă și