Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views13 pages

What Is File System

What is File System

Uploaded by

shishav_jain
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)
6 views13 pages

What Is File System

What is File System

Uploaded by

shishav_jain
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/ 13

File systems

 फाइल स टम ऑपरे टंग स टम के डेटा और ो ाम दोन के Storage और Access के लए System दान


करता है
 फ़ाइल स टम म दो अलग-अलग भाग होते ह: फ़ाइल का सं ह (Collection of files) और नद शका संरचना
(directory structure)
 कुछ फ़ाइल स टम म एक तीसरा भाग, वभाजन(partition) होता है , जो directories के भौ तक (physically) और
ता कक(logical) प से बड़े सं ह को अलग करने के लए उपयोग कया जाता है ।

FILES:

 A file is a named collection of correlated information which is recorded on secondary or non-volatile


storage like magnetic disks, optical disks, and tapes.
 It is a method of data collection that is used as a medium for giving input and receiving output from that
program.
 A file is a logical system, use to store data.

A file is a sequence of bits, bytes, or records whose meaning is defined by the file creator and user. Every File
has a logical location where they are located for storage and retrieval.

Objective of File Management System


Here are the main objectives of the file management system:

 It provides I/O support for a variety of storage device types.


 Minimizes the chances of lost or destroyed data
 Helps OS to standardized I/O interface routines for user processes.
 It provides I/O support for multiple users in a multiuser systems environment.

Properties of a File System


Here, are important properties of a file system:

 Files are stored on disk or other storage and do not disappear when a user logs off.
 Files have names and are associated with access permission that permits controlled sharing.
 Files could be arranged or more complex structures to reflect the relationship between them.

File structure
A File has a certain defined structure according to its types. Three types of files structure in OS:

 A text file: It is a series of characters that is organized in lines.


 A source file: It is a series of functions, subroutine and processes.
 An object file: It is a sequence of bytes that is organized into blocks understandable by the system
linker
 Executable files: it is a series of code sections that the loader can bring into memory and execute.

Notes By: Shishav Jain(8949988236) Page1


File Attributes
A file has a name and data. A file name is usually a string of characters. Moreover, it also stores meta
information like file creation date and time, current size, last modified date, etc. All this information is called the
attributes of a file system.

Here, are some important File attributes used in OS:

 Name: It is the only information stored in a human-


readable form.

Illegal file characters


The given below characters are considered illegal with
most operating systems, hence cannot be used. If
you try to create a file name with these characters,
it would generate an error or make the file
inaccessible.
: ,*, ?, ", < , > , | , \ , / ,%, .(dot), ; , =

In windows 7:

 Identifier: Every file is identified by a unique tag


number within a file system known as an identifier.
 Type: This attribute is required for systems that
support various types of files.

 Location: Points to file location on device.

 Size and size on disk. The Current size of the file


(in bytes). Size on disk is the actual amount of space being taken up on the disk

 Time, date and security: It is used for protection, security, and also used for monitoring
 Protection. This attribute assigns and controls the access rights of reading, writing, and executing the file.

File Operations:

 Create file: when we create a file in operating system, file system finds space on disk for a file, and
make an entry in the directory.
 Write to file, requires positioning within the file (System Call)
 Read from file involves positioning within the file (System Call)
 Delete: content and metadata of the file is deleted..
 Reposition: move read/write position.
 Truncating a file : only content of a file is delete, meta data of a file still remains.

Notes By: Shishav Jain(8949988236) Page2


File Type
It refers to the ability of the operating system to differentiate various types of files like text files, binary, and
source files. However, operating systems like MS_DOS and UNIX has the following type of files:

Ordinary files

 These types of files stores user information.


 It may be text, executable programs, and databases.
 It allows the user to perform operations like add, delete, and modify.

Directory Files
 Directory contains files and other related information about those files. It’s basically a folder to hold and
organize multiple files.

Special Files (Device Files)


 These files are also called device files. It represents physical devices like printers, disks, networks,
flash drive, etc.

File Access Methods


File access is a process that determines the way that files are accessed and read into memory. Generally, a
single access method is always supported by operating systems. Though there are some operating system
which also supports multiple access methods.
Three file access methods are:

 Sequential access
 Direct random access
 Index sequential access

Sequential Access
In this type of file access method, records are
accessed in a certain pre-defined sequence.
In the sequential access method, information
stored in the file is also processed one by
one. Most compilers access files using this
access method.

Random Access (Direct Access)


This method allows accessing the record directly.
Each record has its own address on which can be
directly accessed for reading and writing.

Index Sequential Access


This type of accessing method is based on simple sequential access. In this access method, an index is built
for every file, with a direct pointer to different memory blocks. In this method, the Index is searched
sequentially, and its pointer can access the file directly. Multiple levels of indexing can be used to offer greater
efficiency in access. It also reduces the time needed to access a single record.

Notes By: Shishav Jain(8949988236) Page3


Space Allocation
In the Operating system, files are always allocated disk spaces.Three types of space alloca
allocation methods are:
 Linked Allocation
 Indexed Allocation
 Contiguous Allocation

Contiguous Allocation: In this method,


 Every file uses a contiguous address
space on memory.
 Here, the OS assigns disk address is in
linear order.

Advantage:
1. Sequential and random access both
perform better in contiguous allocation
2. Seek Time is low

Disadvantage:
1. External Fragmentation
2. extending the size of file

Linked Allocation: In this method,

 Every file includes a list of links.


 The directory contains a link or pointer in
the first block of a file.
 With this method, there is no external
fragmentation
 This File allocation method is used for
sequential access files.
 This method is not ideal for a direct access file.

Indexed Allocation: In this method,

 Directory
ry comprises the addresses of index
blocks of the specific files.
 An index block is created, having all the pointers
for specific files.
 All files should have individual index blocks to
store the addresses for disk space.

Notes By: Shishav Jain(8949988236) Page4


File Directories
A single directory (folder) may or may not contain multiple
files. It can also have sub-directories inside the main
directory. Information about files is maintained by Directories.
In Windows OS, it is called folders.
Following is the information which is maintained in a
directory:

 Name The name which is displayed to the user.


 Type: Type of the directory.
 Position: Current next-read/write pointers.
 Location: Location on the device where the file
header is stored.
 Size: Number of bytes, block, and words in the file.
 Protection: Access control on
read/write/execute/delete.
 Usage: Time of creation, access, modification

File types- name, extension


File Type Usual extension Function
Executable exe, com, bin or none ready-to-run machine- language program
Object File obj, o complied, machine language, not linked
Source code c. p, pas, asm, a,.java,.py source code in various languages
Batch bat, sh Series of commands to be executed
Text txt, doc textual data documents
Word processor doc,docs, tex, rrf, etc. various word-processor formats
Library lib, h libraries of routines
Archive arc, zip, tar related files grouped into one file, sometimes compressed.

File management

File management is also referred to as a file system that is a process of creating an organized structure and
retrieving files from a storage medium such as a hard drive. It is a type of software that usually comprise files
separated into groups, which is called directories.

File Allocation Table (FAT)

 File Allocation Table (FAT) is a file system that was developed by Microsoft to support small disks
and simple folder structures.

 The file system is named File Allocation Table because it uses a table to track the clusters on a
storage volume, as well as how those clusters are linked together through their associated files and
directories.

Notes By: Shishav Jain(8949988236) Page5


 The FAT file system got its start with the
introduction of MS-DOS, or Microsoft Disk
Operating System. The original version
was FAT8, followed by FAT12, then FAT16
and finally FAT32. Several variants have
also been developed based on the last
three versions -- FAT12, FAT16 and
FAT32 -- further extending the file system.

 The number associated with each FAT


version (e.g., FAT16) refers to the number
of bits that are used for each entry in the
allocation table.

 The largest file size FAT32 can support is


4 gigabytes, and the largest volume size
is 2 terabytes.

 At one time, the FAT file system was used


extensively for Windows computers.
However, today, most Windows systems
use the New Technology File System (NTFS) -- or, to a lesser degree, the Resilient File System
(ReFS), which Microsoft introduced in 2012 promising to support greater availability, resiliency and
scalability.

 FAT is still used for floppy disks, USB flash drives and storage media in smaller, portable devices such
as digital cameras.

NTFS ( New Technology File system):

NTFS is the newer file system which organize files into sorted directories, introduced in 1993 by Microsoft. This
file system is mostly used in all windows versions in and after Windows NT updates. NTFS provides mostly
features like long file names, large volumes, data security. As compared to FAT 32, some basic difference
between NTFS and FAT 32 are :

Notes By: Shishav Jain(8949988236) Page6


File Extension

A file extension is an identifier that helps identify the type of file in operating systems, such as Microsoft
Windows. It can be classified as a type of metadata, and it helps the operating systems to understand the
intended use of a file and the characteristics. The filename extension may be contained one to four characters
and used as a suffix to the file name. For example, in Microsoft Windows, the file extension is often followed by
three characters.

A dot (.) symbol is used to separate the file extension from the filename. The filename is considered
incomplete without file extension; therefore, to complete a filename, it must be included in the file extension.
Generally, file extensions are hidden from the users in Windows operating systems. Although file extensions
can be renamed, it is not necessarily by renaming a file extension will convert one file format to another. File
extensions are helpful for both users and the file system in two ways:
1. It helps in identifying the type of data that a file hold.
2. It allows the operating system to select the proper program or application with which to open a file.

Limit of a file extension


Until the file name, path, and extension are not combined, the limit of file extension does not exceed the limit of
the maximum file name character. There is given a list below, which contains Microsoft operating systems
(Windows) versions and their filename character limit.
o Windows XP: It contains a limit of 255 characters.
o Windows 7: It includes a limit of 260 characters.
o Windows 2000: Its limit is 254 characters.
o Windows Vista: Its limit is 260 characters.
o Windows 8: It includes a limit of 260 characters.
o Windows 10: It contains a limit of 260 characters.

Note :

Ms-Dos operating system allowed 8 characters for the filename and 3 characters for the extension, for the
total of 12 characters including dot.

Notes By: Shishav Jain(8949988236) Page7


MCQ ON FILE SYSTEM

1. Which of the following is a named collection of D. Location


related information that is recorded on secondary
storage and is the smallest allotment of logical 7. Which of the following file attribute information is
secondary storage? needed for systems that support different types of
A. Directory files?
B. File A. Name
C. Disk B. Type
D. All of the above C. Identifier
2. In Which of the following is a sequence of D. size
characters organized into lines (and possibly
pages) ? 8. Which of the following file attribute a information
A. Text file is a pointer to a device and to the location of the file
B. Source file on that device?
C. Executable file A. Name
D. None of the above. B. Size
C. Time, date, and user identification.
3. In which of the following a sequence of functions, D. Location
each of which is further organized as declarations
followed by executable statements is stored? 9. Which of the following file attribute, the current
A. Text file size of the file (in bytes, words, or blocks) and
B. Source file possibly the maximum allowed size are included?
C. Executable file A. Protection
D. All of the above. B. Size
4. In which of the following file is a series of code C. Identifier
sections that the loader can bring into memory and D. Type
execute?
A. Text file 10. Which of the following file attribute Access-
B. Source file control information determines who can do reading,
C. Executable file writing, executing, and so on?
D. Distributed file A. Protection
B. identifier
5. A file is named, for the convenience of its human C. Type
users, and is referred to by its ______ D. Time, date, and user identification
A. Name
B. Type 11. The information about all files is kept in the
C. Identifier ________ which also resides on secondary
D. size storage.
A. Disk structure
6. Which of the following file attribute is the unique B. Directory structure
tag, usually a number, identifies the file within the C. Array structure
file system; it is the non-human-readable name for D. All of the above
the file?
A. Name
B. Identifier
C. Size
Notes By: Shishav Jain(8949988236) Page8
12. Which of following basic operations that can be C. Open-file table
performed on files by the operating System’s D. A and C
system calls?
A. Read, Write, Delete 17. The _______________needed to locate the file
B. Write, Paint, reposition on disk is kept in memory so that the system does
C. Delete, truncate files, Sorting not have to read it from disk for each operation.
D. All of the above. A. File pointer
B. File-open count
13. Which of the following steps are necessary to C. Disk location of the file.
create a file? D. Access rights
A. space in the file system must be found for
the file 18. This ________ is stored on the per-process
B. an entry for the new file must be made in table so the operating system can allow or deny
the directory subsequent I/O requests.
C. Both A and B A. File pointer
D. None of the above. B. File-open count
14. Which of the following file operation is also C. Disk location of the file.
known as file seek? D. Access rights
A. Truncating a file
B. Deleting a file 19. ______ tracks the number of opens and closes
C. Repositioning within a file and reaches zero on the last close.The system can
D. Reading a file then remove the entry.
A. File pointer
15. Which of the following Statements stands true B. File-open count
for creating a file? C. Disk location of the file.
A. We search the directory for the named file. D. Access rights
Having found the associated directory entry, we
release all file space, so that it can be reused by 20. ______ is unique to each process operating on
other files, and erase the directory entry. the file and therefore must be kept separate from
B. The directory is searched for the the on-disk file attributes.
appropriate entry, and the current-file-position A. File pointer
pointer is re-positioned to a given value. B. File-open count
C. Space in the file system must be found for C. Disk location of the file.
the file and an entry for the new file must be made D. Access rights
in the directory.
D. We use a system call that specifies the 21. The system uses the _______ to indicate the
name of the file and where (in memory) the next type of the file and the type of operations that can
block of the file should be put. Again, the directory be on that file.
is searched for the associated entry, and the A. Size
system needs to keep a read pointer to the location B. Location
in the file where the next read is to take place. C. Date time
D. Extension
16. The operating system keeps a table, called
the _______, containing information about all open
files.
A. per-process table
B. system-wide table
Notes By: Shishav Jain(8949988236) Page9
22. A file with extension______ is the binary 29. Which of the following has the file type of
executable file. markup?
A. .txt A. exe, com, bin or none
B. .docx B. rar, zip, tar
C. .sh C. xml, html, tex
D. .exe D. xml, rtf, docx

23. Which of the following file with extension 30. Which of the following is known as batch file?
______is the binary executable file? A. exe, com, bin or none
A. .txt B. obj, o
B. .docx C. lib, a, so, dll
C. .sh D. bat, sh
D. .com
31. Which of the following file extension is for the
24. _________ is a shell script containing, in ASCII file containing source code in various languages?
format, commands to the operating system. A. exe, com, bin or none
A. .txt B. obj, o
B. .docx C. lib, a, so, dll
C. .sh D. c, cc, java, perl
D. .com
32. ________file extension has the function of
25. binary file containing audio or A/V information compiled, machine language, not linked.
A. exe, com, bin or none A. exe, com, bin or none
B. c, cc, java, perl, asm B. obj, o
C. xml, html, tex C. lib, a, so, dll
D. mpeg, mov, mp3, mp4, avi D. c, cc, java, perl

26. related files grouped into one file, sometimes 33. Mapping of file is managed by
compressed, for archiving or storage a) file metadata b) page table
A. exe, com, bin or none c) virtual memory d) file system
B. rar, zip, tar
C. xml, html, tex 34. Mapping of network file system protocol to local
D. mpeg, mov, mp3, mp4, avi file system is by ____________
a) network file system b) local file system
27. libraries of routines for programmers c) volume manager d) remote mirror
A. exe, com, bin or none 35. When will file system fragmentation occur?
B. rar, zip, tar a) unused space or single file are not contiguous
C. xml, html, tex b) used space is not contiguous
D. lib, a, so, dll c) unused space is non-contiguous
d) multiple files are non-contiguous
28. which of the following are various word- Answer: unused space or single file are not
processor formats?
A. exe, com, bin or none 36. Which one of the following explains the
B. rar, zip, tar sequential file access method?
C. xml, html, tex a) random access according to the given byte
D. xml, rtf, docx number
b) read bytes one at a time, in order
Notes By: Shishav Jain(8949988236) P a g e 10
c) read/write sequentially by record 44. What is raw disk?
d) read/write randomly by record a) disk without file system
b) empty disk
37. What is the mounting of file system? c) disk lacking logical file system
a) crating of a filesystem d) disk having file system
b) deleting a filesystem
c) attaching portion of the file system into a 45. For a direct access file ____________
directory structure a) there are restrictions on the order of reading and
d) removing the portion of the file system into a writing
directory structure b) there are no restrictions on the order of reading
and writing
38. To create a new file application program calls c) access is restricted permission wise
____________ d) access is not restricted permission wise
a) basic file system
b) logical file system 46. The index contains ____________
c) file-organization module a) names of all contents of file
d) none of the mentioned b) pointers to each page
c) pointers to the various blocks
39. If the block of free-space list is free then bit will d) all of the mentioned
____________
a) 1 b) 0 47. A relative block number is an index relative to
c) any of 0 or 1 d) none of these ____________
a) the beginning of the file
40. The data structure used for file directory is b) the end of the file
called ____________ c) the last written position in file
a) mount table b) hash table d) none of the mentioned
c) file table d) process table
41. A file control block contains the information 48. Data cannot be written to secondary storage
about ____________ unless written within a ______
a) file ownership a) file b) swap space
b) file permissions c) directory d) text format
c) location of file contents
d) all of the mentioned 49. A file is a/an _______ data type.
a) abstract b) primitive
42. Management of metadata information is by c) public d) private
____________
a) file-organization module 50. The direct access method is based on a
b) logical file system ______ model of a file
c) basic file system a) magnetic tape b) tape
d) application programs c) disk d) all of these

43. In which type of allocation method each file 51. For large files, when the index itself becomes
occupy a set of contiguous block on the disk? too large to be kept in memory?
a) contiguous allocation a) index is called
b) dynamic-storage allocation b) an index is created for the index file
c) linked allocation c) secondary index files are created
d) indexed allocation d) all of the mentioned
Notes By: Shishav Jain(8949988236) P a g e 11
52. FAT stands for _____________ 58) The yellow smaller sections that is created on
a) File Attribute Transport each drives, when given meaningful names will
b) File Allocation Table reflect the type and contents of file in them.
c) Fork At Time a) Folder b) File
d) None of the mentioned
c) Data d) Information

53. One difficulty of contiguous allocation is


_____________ 59) A folder within (inside) a big folder is called
a) finding space for a new file a) Deputy folder b) container folder
b) inefficient c) costly c) internal folder d) Sub-folder
d) time taking
54. Metadata includes _____________
a) all of the file system structure 60) If you have wrongly name a file or folder or
b) contents of files make a spelling mistake while typing the name of
c) both file system structure and contents of files your file or folder, you can
d) none of the mentioned a) Rename b) reset
c) rechange d) recreate
55) While adding the filename to your file, there is
need of remembering the rules as 61) It is process of creating a copy of the original
a) The maximum length of the file in Windows OS file or folder in the destination location without
is upto 255 characters and for in DOS, the removing the original one from the source location.
maximum of eight characters and the extension. a) Moving a file or folder
b) You can make use of uppercase or lowercase b) deleting a file or folder
letters, or numbers for the file name.
c) copying a file or folder
c) You can’t make use of the special characters in
d) All of these
your file name like < (less than), > (greater than), :
(colon), ” (double quote), / (forward slash), \
(backslash), | (vertical bar), * (asterisk), ? (Question 62) The process of removing the file or folder from
mark) etc. the source location and placing it in the destination
d) All of these location:
a) Moving a file or folder

56) In …………………., the file extension is usually b) deleting a file or folder


hidden from the user. c) copying a file or folder
a) Graphical user Interface d) All of these
b) Character User Interface
c) Picture User Interface 63) The process of removing the file from the
d) All of these original location and moving it to the Recycle Bin
a) Sharing a file or folder

57) It is divided in different partitions, and been b) copying a file or folder


identified with the drive letters C, D, E etc c) moving a file or folder
a) Compact Disk b) Floppy disk d) deleting a file or folder
c) Hard disk c) Both A and B

Notes By: Shishav Jain(8949988236) P a g e 12


64) Incase if you accidently delete a file or folder, 67. Which file system Windows 95 typically
you can ………………….. it again from the Recycle use?
Bin. A. FAT 16 B. FAT 32
a) Retake b) Recreate C. NTFS D. LMFS
c) Restore d) Both A and B
68. The file system "NTFS" stands for
A. New Type File System
65) It is used to store or organize your files and B. Never Terminated File System
folders C. New Technology File System
a) Folder b) Hard disk D. Non Terminated File System
c) memory d) None of these
69. Which is not a valid file system?
66. Which file system DOS typically use? A. FAT 16 B. FAT 32
A. FAT 16 B. FAT 32 C. NTFS D. FXZ
C. NTFS D. LMFS

1 B 16 A 31 D 46 C 61 C
2 A 17 C 32 B 47 A 62 A
3 B 18 D 33 A 48 A 63 D
4 C 19 B 34 A 49 A 64 C
5 A 20 A 35 C 50 C 65 A
6 B 21 D 36 b 51 B 66 A
7 B 22 D 37 c 52 B 67 B
8 D 23 D 38 D 53 A 68 C
9 B 24 C 39 A 54 C 69 D
10 A 25 D 40 B 55 D 70
11 B 26 B 41 D 56 A 71
12 A 27 D 42 B 57 C 72
13 C 28 D 43 A 58 A 73
14 C 29 C 44 A 59 D 74
15 C 30 D 45 B 60 A 75

Notes By: Shishav Jain(8949988236) P a g e 13

You might also like