© 2026 schoolict.net (Ruwan Mangala Suraweera)
5.2 Files, Directories and Storage Allocationගොනු, ඩිරෙක්ටරි සහ ගබඩා වෙන් කිරීම
Grade 12 A/L ICT · Lesson 512 ශ්රේණිය A/L ICT · පාඩම 5
In this videoමේ වීඩියෝවේ
- Files have types/extensions and attributes; directories form a hierarchy.ගොනුවල වර්ග/දිගු සහ ගුණාංග ඇත; ඩිරෙක්ටරි ධුරාවලියක් සාදයි.
- File systems (e.g. FAT) organise data on disk.ගොනු පද්ධති (උදා: FAT) තැටියේ දත්ත සංවිධානය කරයි.
- Security uses passwords and access privileges.ආරක්ෂාවට මුරපද සහ ප්රවේශ වරප්රසාද යොදයි.
- Allocation: contiguous, linked, indexed – each with trade-offs.වෙන් කිරීම: අනුයාත, සබැඳි, දර්ශක – එක් එක් හුවමාරුවක් සමඟ.
- Defragmentation packs blocks; formatting prepares a file system.විඛණ්ඩනය ඉවත් කිරීම කොටස් එකට; ආකෘතිකරණය ගොනු පද්ධතිය සකසයි.
Notesසටහන්
Syllabus 5.2. The OS organises your data as files and directories, using a file system (for example FAT-style). In this part you learn file types, the hierarchy, security (passwords and privileges), how space is given out with contiguous, linked and indexed allocation, why defragmentation helps, and why disks are formatted.විෂය නිර්දේශය 5.2. OS ඔබේ දත්ත ගොනු සහ ඩිරෙක්ටරි ලෙස සංවිධානය කරයි, ගොනු පද්ධතියක් (උදා: FAT වැනි) භාවිතයෙන්. මෙම කොටසින් ගොනු වර්ග, ධුරාවලිය, ආරක්ෂාව (මුරපද සහ වරප්රසාද), අනුයාත, සබැඳි සහ දර්ශක වෙන් කිරීම, විඛණ්ඩනය ඉවත් කිරීම, සහ තැටි ආකෘතිකරණය ඉගෙන ගනී.
1. Files, types and attributes1. ගොනු, වර්ග සහ ගුණාංග
A file is a named collection of related bytes. The extension (.exe, .jpg, .txt, .docx, .mp4) hints at the type so the OS and apps know how to open it. Attributes include name, size, type, location, creation/modification time, and access permissions.ගොනුවක් යනු නම් කළ අදාළ බයිට් එකතුවකි. දිගුව (.exe, .jpg, .txt, .docx, .mp4) වර්ගය ඉඟි කරයි. ගුණාංග අතර නම, ප්රමාණය, වර්ගය, ස්ථානය, කාලය සහ ප්රවේශ අවසර ඇත.
photo.jpg to photo.txt does not turn pixels into text – it only changes the label the OS shows.දිගු සම්මුති වේ. photo.jpg photo.txt ලෙස නම් කිරීමෙන් පික්සල් පෙළ බවට නොපත් වේ – OS පෙන්වන ලේබලය පමණක් වෙනස් වේ.2. Directory hierarchy and file systems2. ඩිරෙක්ටරි ධුරාවලිය සහ ගොනු පද්ධති
Directories form a tree from a root. A path like /home/amma/notes.txt walks from root to the file. A file system (FAT, NTFS, ext4, APFS, …) is the on-disk layout of directories, files and free space. Older syllabuses often mention FAT as a classic example.ඩිරෙක්ටරි මුල් සිට ගසක් සාදයි. /home/amma/notes.txt වැනි මාර්ගයක් මුල සිට ගොනුවට යයි. ගොනු පද්ධතියක් (FAT, NTFS, ext4, APFS, …) තැටියේ සැකැස්මයි. විෂය නිර්දේශයේ FAT සම්භාව්ය උදාහරණයකි.
3. File security3. ගොනු ආරක්ෂාව
- Passwords / accounts control who can log in.මුරපද / ගිණුම් ලොගින් විය හැක්කේ කාටදැයි පාලනය කරයි.
- Access privileges (read, write, execute; owner/group/others) limit what each user may do to a file.ප්රවේශ වරප්රසාද (කියවීම, ලිවීම, ක්රියාත්මක; හිමිකරු/කණ්ඩායම/අනෙක්) සීමා කරයි.
- The OS enforces these rules on every open, read and write.සෑම විවෘත කිරීමක්, කියවීමක් සහ ලිවීමක් මත OS මෙම නීති බලාත්මක කරයි.
4. Storage allocation methods4. ගබඩා වෙන් කිරීමේ ක්රම
A: blocks 0–1; B: 2–4; C: 5–5; free = 4 blocks.A: 0–1; B: 2–4; C: 5–5; නිදහස් = කොටස් 4.
| Fileගොනුව | Start blockආරම්භක කොටස | End blockඅවසාන කොටස |
|---|---|---|
| AA | 00 | 11 |
| BB | 22 | 44 |
| CC | 55 | 55 |
1 index block + 5 data blocks = 6 blocks.දර්ශක 1 + දත්ත 5 = කොටස් 6.
5. Defragmentation and formatting5. විඛණ්ඩනය ඉවත් කිරීම සහ ආකෘතිකරණය
Fragmentation spreads a file’s blocks around the disk so the head jumps more. Defragmentation packs related blocks closer to speed sequential reads (more relevant to HDDs than SSDs). Formatting prepares a disk with a file system structure (and usually erases previous contents) so the OS can store files.විඛණ්ඩනය ගොනුවක කොටස් තැටියේ විසිරුවයි. විඛණ්ඩනය ඉවත් කිරීම අනුක්රමික කියවීම වේගවත් කරයි (HDD වල වැඩිපුර). ආකෘතිකරණය ගොනු පද්ධති ව්යුහයක් සකසයි (බොහෝ විට පෙර අන්තර්ගතය මකයි).
Key Wordsප්රධාන පද
Sample Q&Aආදර්ශ ප්රශ්න සහ පිළිතුරු
1Why do file types / extensions matter?ගොනු වර්ග / දිගු වැදගත් වන්නේ ඇයි?
2What is a file system?ගොනු පද්ධතියක් යනු කුමක්ද?
3Name three storage allocation methods.ගබඩා වෙන් කිරීමේ ක්රම තුනක් නම් කරන්න.
4What problem does contiguous allocation often face?අනුයාත වෙන් කිරීම බොහෝ විට මුහුණ දෙන ගැටලුව කුමක්ද?
5What does defragmentation do?විඛණ්ඩනය ඉවත් කිරීම කරන්නේ කුමක්ද?
6Why format a disk?තැටියක් ආකෘතිකරණය කරන්නේ ඇයි?
MCQබහුවරණ ප්රශ්න
Choose the correct answer for each question.සෑම ප්රශ්නයකටම නිවැරදි පිළිතුර තෝරන්න.
1A directory isඩිරෙක්ටරියක් යනු
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Hierarchy container.ධුරාවලි භාජනය.
2FAT stands forFAT යනු
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Classic file system.සම්භාව්ය ගොනු පද්ධතිය.
3Contiguous allocation stores a file inඅනුයාත වෙන් කිරීම ගොනුව ගබඩා කරන්නේ
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
One run of blocks.කොටස් දාමයක්.
4Linked allocation usesසබැඳි වෙන් කිරීම භාවිත කරන්නේ
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Block chain.කොටස් දාමය.
5Indexed allocation keepsදර්ශක වෙන් කිරීම තබා ගන්නේ
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Index + data.දර්ශක + දත්ත.
6External fragmentation is typical ofබාහිර විඛණ්ඩනය සාමාන්යයෙන්
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Holes between contiguous files.අනුයාත ගොනු අතර සිදුරු.
7Defragmentation mainly helpsවිඛණ්ඩනය ඉවත් කිරීම ප්රධාන වශයෙන් උදව් වන්නේ
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Pack file pieces.ගොනු කැබලි එකට.
8Formatting a disk usuallyතැටියක් ආකෘතිකරණය සාමාන්යයෙන්
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Prepare file system.ගොනු පද්ධතිය සකසයි.
9Access privileges controlප්රවේශ වරප්රසාද පාලනය කරන්නේ
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: A
Permissions.අවසර.
10Path /home/amma/notes.txt starts atමාර්ගය /home/amma/notes.txt අරඹන්නේ
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
Root of the tree.ගසේ මුල.
11With contiguous allocation A=2,B=3,C=1 from block 0 on a 10-block disk, free blocks =අනුයාතව A=2,B=3,C=1 කොටස් 0 සිට කොටස් 10 තැටියක, නිදහස් =
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
2+3+1=6 used; 10−6=4.2+3+1=6; 10−6=4.
12One-level index + 5 data blocks uses how many blocks?එක්-මට්ටමේ දර්ශක + දත්ත 5 කට කොටස් කීයක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
1+5=6.1+5=6.
13Which term means: “Named collection of related bytes”?“නම් කළ අදාළ බයිට් එකතුවකි” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
File – Named collection of related bytes.ගොනුව – නම් කළ අදාළ බයිට් එකතුවකි.
14Which term means: “.exe .jpg .txt etc. hint how to open the file”?“ගොනුව විවෘත කරන ආකාරය ඉඟි කරයි” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: B
File type / extension – .exe .jpg .txt etc. hint how to open the file.ගොනු වර්ගය / දිගුව – ගොනුව විවෘත කරන ආකාරය ඉඟි කරයි.
15Which term means: “Container in the file hierarchy”?“ගොනු ධුරාවලියේ භාජනයකි” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
Directory / folder – Container in the file hierarchy.ඩිරෙක්ටරිය / ෆෝල්ඩරය – ගොනු ධුරාවලියේ භාජනයකි.
16Which term means: “On-disk organisation of files and free space (e.g. FAT)”?“තැටියේ ගොනු සහ නිදහස් ඉඩ සංවිධානය (උදා: FAT)” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
File system – On-disk organisation of files and free space (e.g. FAT).ගොනු පද්ධතිය – තැටියේ ගොනු සහ නිදහස් ඉඩ සංවිධානය (උදා: FAT).
17Which term means: “File Allocation Table – a classic simple file system”?“File Allocation Table – සම්භාව්ය සරල ගොනු පද්ධතියකි” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: D
FAT – File Allocation Table – a classic simple file system.FAT – File Allocation Table – සම්භාව්ය සරල ගොනු පද්ධතියකි.
18Which term means: “Read/write/execute rights for users or groups”?“පරිශීලකයින්ට හෝ කණ්ඩායම්වලට කියවීම/ලිවීම/ක්රියාත්මක අයිති” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Access privileges – Read/write/execute rights for users or groups.ප්රවේශ වරප්රසාද – පරිශීලකයින්ට හෝ කණ්ඩායම්වලට කියවීම/ලිවීම/ක්රියාත්මක අයිති.
19Which term means: “File stored in neighbouring blocks”?“අසල්වැසි කොටස්වල ගොනුව ගබඩා වේ” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: C
Contiguous allocation – File stored in neighbouring blocks.අනුයාත වෙන් කිරීම – අසල්වැසි කොටස්වල ගොනුව ගබඩා වේ.
20Which term means: “Blocks chained by pointers”?“පොයින්ටර මගින් කොටස් දාමගත වේ” යන්නෙන් අදහස් වන පදය කුමක්ද?
✔ Correct!නිවැරදියි!✘ Not quite.වැරදියි. Correct answerනිවැරදි පිළිතුර: E
Linked allocation – Blocks chained by pointers.සබැඳි වෙන් කිරීම – පොයින්ටර මගින් කොටස් දාමගත වේ.
MCQ answer keyMCQ පිළිතුරු
- A – Hierarchy container.ධුරාවලි භාජනය.
- B – Classic file system.සම්භාව්ය ගොනු පද්ධතිය.
- A – One run of blocks.කොටස් දාමයක්.
- C – Block chain.කොටස් දාමය.
- B – Index + data.දර්ශක + දත්ත.
- D – Holes between contiguous files.අනුයාත ගොනු අතර සිදුරු.
- A – Pack file pieces.ගොනු කැබලි එකට.
- E – Prepare file system.ගොනු පද්ධතිය සකසයි.
- A – Permissions.අවසර.
- B – Root of the tree.ගසේ මුල.
- D – 2+3+1=6 used; 10−6=4.2+3+1=6; 10−6=4.
- E – 1+5=6.1+5=6.
- E – File – Named collection of related bytes.ගොනුව – නම් කළ අදාළ බයිට් එකතුවකි.
- B – File type / extension – .exe .jpg .txt etc. hint how to open the file.ගොනු වර්ගය / දිගුව – ගොනුව විවෘත කරන ආකාරය ඉඟි කරයි.
- D – Directory / folder – Container in the file hierarchy.ඩිරෙක්ටරිය / ෆෝල්ඩරය – ගොනු ධුරාවලියේ භාජනයකි.
- C – File system – On-disk organisation of files and free space (e.g. FAT).ගොනු පද්ධතිය – තැටියේ ගොනු සහ නිදහස් ඉඩ සංවිධානය (උදා: FAT).
- D – FAT – File Allocation Table – a classic simple file system.FAT – File Allocation Table – සම්භාව්ය සරල ගොනු පද්ධතියකි.
- C – Access privileges – Read/write/execute rights for users or groups.ප්රවේශ වරප්රසාද – පරිශීලකයින්ට හෝ කණ්ඩායම්වලට කියවීම/ලිවීම/ක්රියාත්මක අයිති.
- C – Contiguous allocation – File stored in neighbouring blocks.අනුයාත වෙන් කිරීම – අසල්වැසි කොටස්වල ගොනුව ගබඩා වේ.
- E – Linked allocation – Blocks chained by pointers.සබැඳි වෙන් කිරීම – පොයින්ටර මගින් කොටස් දාමගත වේ.
Structured Questionsව්යුහගත ප්රශ්න
1Explain why file types are needed and name three extensions.ගොනු වර්ග අවශ්ය වන්නේ ඇයිදැයි පැහැදිලි කර දිගු තුනක් නම් කරන්න. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
2Describe a directory hierarchy with a short path example.කෙටි මාර්ග උදාහරණයක් සමඟ ඩිරෙක්ටරි ධුරාවලිය විස්තර කරන්න. (3 marksලකුණු 3)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
3Compare contiguous and linked allocation (one advantage each, one drawback each).අනුයාත සහ සබැඳි වෙන් කිරීම සංසන්දනය කරන්න (වාසි/අවාසි බැගින්). (2 marksලකුණු 2)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
4A 10-block disk stores A=2,B=3,C=1 contiguously from 0. Give ranges and free count.කොටස් 10 තැටියක A=2,B=3,C=1 0 සිට අනුයාතව. පරාස සහ නිදහස් ගණන දෙන්න. (2 marksලකුණු 2)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
5Explain defragmentation and formatting briefly.විඛණ්ඩනය ඉවත් කිරීම සහ ආකෘතිකරණය කෙටියෙන් පැහැදිලි කරන්න. (2 marksලකුණු 2)
Show model answerආදර්ශ පිළිතුර පෙන්වන්න
🎮 Game🎮 ක්රීඩා
Summary & Downloadsසාරාංශය සහ බාගත කිරීම්
Key pointsප්රධාන කරුණු
- Files have types/extensions and attributes; directories form a hierarchy.ගොනුවල වර්ග/දිගු සහ ගුණාංග ඇත; ඩිරෙක්ටරි ධුරාවලියක් සාදයි.
- File systems (e.g. FAT) organise data on disk.ගොනු පද්ධති (උදා: FAT) තැටියේ දත්ත සංවිධානය කරයි.
- Security uses passwords and access privileges.ආරක්ෂාවට මුරපද සහ ප්රවේශ වරප්රසාද යොදයි.
- Allocation: contiguous, linked, indexed – each with trade-offs.වෙන් කිරීම: අනුයාත, සබැඳි, දර්ශක – එක් එක් හුවමාරුවක් සමඟ.
- Defragmentation packs blocks; formatting prepares a file system.විඛණ්ඩනය ඉවත් කිරීම කොටස් එකට; ආකෘතිකරණය ගොනු පද්ධතිය සකසයි.
