- OS - Home
- OS - Needs
- OS - Overview
- OS - History
- OS - Components
- OS - Structure
- OS - Architecture
- OS - Services
- OS - Properties
- Process Management
- OS - Processes
- OS - Process Control Block
- OS - Operations on Processes
- OS - Inter Process Communication
- OS - Context Switching
- OS - Multi-threading
- Scheduling Algorithms
- OS - Process Scheduling
- Preemptive and Non-Preemptive Scheduling
- Scheduling Algorithms Overview
- FCFS Scheduling Algorithm
- SJF Scheduling Algorithm
- Round Robin Scheduling Algorithm
- HRRN Scheduling Algorithm
- Priority Scheduling Algorithm
- Multilevel Queue Scheduling
- Lottery Scheduling Algorithm
- OS - TAT & WAT
- Predicting Burst Time in SJF Scheduling
- Process Synchronization
- OS - Process Synchronization
- OS - Critical Section Problem
- OS - Critical Section Synchronization
- OS - Mutual Exclusion Synchronization
- OS - Semaphores
- OS - Counting Semaphores
- OS - Mutex
- OS - Turn Variable
- OS - Bounded Buffer Problem
- OS - Reader Writer Locks
- OS - Test and Set Lock
- OS - Peterson's Solution
- OS - Monitors
- OS - Sleep and Wake
- OS - Race Condition
- OS Deadlock
- Introduction to Deadlock in Operating System
- Conditions for Deadlock in Operating System
- Memory Management
- OS - Memory Management
- OS - Contiguous Memory Allocation
- OS - Non-Contiguous Memory Allocation
- OS - First Fit Algorithm
- OS - Next Fit Algorithm
- OS - Best Fit Algorithm
- OS - Worst Fit Algorithm
- OS - Fragmentation
- OS - Virtual Memory
- OS - Segmentation
- OS - Buddy System
- OS - Allocating Kernel Memory
- OS - Overlays
- Paging and Page Replacement
- OS - Paging
- OS - Demand Paging
- OS - Page Table
- OS - Page Replacement Algorithms
- OS - Optimal Page Replacement Algorithm
- OS - Belady's Anomaly
- OS - Thrashing
- Storage and File Management
- OS - File Systems
- OS - File Attributes
- OS - Structures of Directory
- OS - Linked Index Allocation
- OS - Indexed Allocation
- I/O Systems
- OS - I/O Hardware
- OS - I/O Software
- OS Types
- OS - Types
- OS - Batch Processing
- OS - Multiprocessing
- OS - Hybrid
- OS - Monolithic
- OS - Zephyr
- OS - Nix
- OS - Linux
- OS - Blackberry
- OS - Garuda
- OS - Tails
- OS - Clustered
- OS - Haiku
- OS - AIX
- OS - Solus
- OS - Tizen
- OS - Bharat
- OS - Fire
- OS - Bliss
- OS - VxWorks
- OS - Embedded
- OS - Single User
- Miscellaneous Topics
- OS - Security
- OS Questions Answers
- OS - Questions Answers
- OS Useful Resources
- OS - Quick Guide
- OS - Useful Resources
- OS - Discussion
File Attributes in Operating System
A file stores content or information on a disk. It is the smallest unit for storing data, and without files, it is impossible to store any information on a system.
In addition to storing data, a file also possesses attributes that provide metadata or details about the file itself. These attributes play an essential role in managing and handling files, regardless of their content.
What is File Attributes in Operating System?
File attributes are the special parameters that are used to store the metadata of the specified file. Here, metadata is data which provides the information about the file rather than the content of the file. It specifies the behaviour, characteristics, and properties of the file, which helps operating system and users how to manage files.
The attributes of files are used to manage the visibility, access and other functionalities of the file. It can also provide information about the file, like when it was created, last modified, or last accessed.
We can modify the attributes of the file according to the operating system, for example, if we are using Windows, then we can modify the attributes of the file by right click on the file, then select properties, and then we can modify the attributes. If we are using macOS, then right-click on the file and then select the get info option to set the file attributes.
Different Types of File Attributes in OS
Operating system provides a variety of attributes for a file. Using these attributes, we can specify the properties of the stored file so that we can access it very easily. The attributes supported by the operating system are as follows:
Name: The name attribute is used to store the name of the file. It is of string type and provides unique and human read identity to the specififed file. It prevents users from saving files with duplicate names.
Identifier:The identifier attribute is used to store the extension of the file. It specifies what type of data is stored in the given file. The most commonly used file extensions are − .txt, .mp4, .jpg, etc.
Types: The Type attribute is also used to specify the type of the file such as zip file, audio file, video file, etc.
Location: The location attributed is used to specify the location of the file. Or we can say that it is used to specify the directory path so that we can easily locate the file.
Size: The size attribute is used to specify the size of the file in Kb, Mb, etc.
Protection:The protection attribute is used to provide information about the access control of the file. It is commonly used to provide security to the given file by applying the permissions. Using this, we can control who can read, write, and execute files.
Time and date: This attribute is used to provide information about when and at what time the file is created or modified.
Read-only Flag: The read-only flag determines whether the file is read-only or not. If the value of this file is set to 0, it means that the file can be read or written. Or if the value of the flag is set to 1, then that means the flag is read-only.
Hidden Flag: The hidden flag determines whether the file is hidden from the normal directory or not.
System Flag: The system flag is used to mark the file as a system file. It is hidden from the regular user to avoid modifications. It is only used by the operating system.
Archive Flag: The archive flag is used to mark the file as a needing system.
ASCII/Binary Flag: The ASCII/Binary flag is used to specify the format of the file content either in ASCII mode or Binary mode. If the value of this flag is 1, then that means the file is an ASCII file. Otherwise, the file is binary.
Random Access Flag: The random access flag allows the user to directly access any part of the file. It allows random read and write operations.
Temporary Flag: The temporary flag marks the specified file temporarily and can be deleted after it's used. It is commonly used for temporary storage or caching.
Lock Flag: The lock flag is used to lock the file. It keeps files from multiple access. If the value of this flag is 0, then that means the file is unlocked, it is not.