Javatpoint Logo
Javatpoint Logo

Difference between physical and logical file systems in OS

In this article, you will learn the difference between physical and logical file systems. But before discussing the differences, you must know about the physical and logical file systems.

What is the Physical File System?

Physical files have the real data saved on an iSeries system and describe how the data is to be displayed to or retrieved from a program. They only have one type of record and one or more members. A field-level description or a record-level description can be used to describe records in database files.

The field-level description defines the fields of the record. On the other hand, the record-level description defines the length of the record. Program-described files are database files that are prepared with record-level descriptions. Externally specified files are database files that are prepared with field-level descriptions. It means that the fields in the record must be described in your ILE C/C++ software.

Externally specified or an ILE C/C++ program can use program-described files. If the program requires an externally described file, the ILE C/C++ compiler may extract data from it and automatically add field information to it. The field information does not need to be defined in your program. A keyed sequence access path can exist for a physical file. It means that data is given to an ILE C/C++ program in a specific sequence that is based on various key fields in the file.

What is the Logical File System?

A logical file represents or perspectives multiple physical files. Logical files don't have data. They have a description of the records found in multiple physical files. Multi-format logical files are logical files that contain various formats.

If your program is processing a logical file with multiple record formats, you may use the _Rformat() function to specify which format to use. Some operations on logical files are not allowed. When you open a logical file for stream and record file processing using the open modes W, W+, WB, WB+, WR, or WR+, the file is opened but not cleared. A field-level description or a record-level description can be used to describe records in iSeries database files.

The record's field-level description describes all fields and how they are organized in this record. Database files built with a field-level description are externally described because the fields' description and layout are preserved within the database file rather than in your ILE C/C++ software.

Key differences between the Physical and Logical File System

Difference between physical and logical file systems in OS

Here, you will learn the various key differences between Physical and Logical File Systems. Various differences between Physical and Logical File Systems are as follows:

  1. Physical files have the real data saved on an iSeries system and describe how the data is to be displayed to or retrieved from a program. On the other hand, the logical file represents or perspective of one or more physical files. Logical files don't contain data. They have a description of the records found in multiple physical files.
  2. Physical files exist without logical files. On the other hand, a Logical file cannot exist without a physical file.
  3. If there is a logical file for a physical file, the physical file may not be erased until the logical file is deleted. On the other hand, if a physical file has a logical file, the logical file can be removed without deleting the actual file.
  4. Physical files take up space in memory. It includes the original data. On the other hand, a Logical file does not take up any memory space. It does not include data.
  5. The CRTPF command is utilized to make such an object in a physical file. On the other hand, the CRTLF command is utilized to make such an object in a logical file system.
  6. A physical file has one record format. On the other hand, a Logical file may include up to 32 record formats.

Head-to-head comparison between Physical and Logical File System

Here, you will learn the head-to-head comparisons between the Physical and the Logical File System. The main differences between the Physical and the Logical File System are as follows:

Physical File System Logical File System
Physical files have the real data saved on an iSeries system and describe how the data is to be displayed to or retrieved from a program. The logical file represents or perspective of one or multiple physical files. Logical files don't have data. They have a description of the records found in one or multiple physical files.
It takes up space in memory, and it includes the original data. It doesn't take up any memory space. It does not include data.
It exists without a Logical file. A logical file cannot exist without a physical file.
The CRTPF command is utilized to make such an object in a physical file. The CRTLF command is utilized to make such an object in a logical file system.
If there is a logical file for a physical file, the physical file may not be erased until the logical file is deleted. If a physical file has a logical file, the logical file can be removed without deleting the actual file.
The physical file system has one record format. The logical file system may include up to 32 record formats.






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA