Directory Systems, File Management Functions

एक directory system एक केंद्रीय lookup index के रूप में काम करता है जो मानव पठनीय names को physical disk blocks से map करता है, जबकि file management उन files के पूरे lifecycle और security को सँभालता है।

10 min read · 10 cards · 3 checks

Read in: English · हिन्दी · ગુજરાતી


Theory

दस लाख File का दुःस्वप्न

कल्पना कीजिए LabOne पर 30 students एक साथ काम कर रहे हैं, हर एक हफ़्ते सैकड़ों files बनाते हुए। अब कल्पना कीजिए अगर operating system इन सारी files को बिना किसी संगठन के hard drive पर एक अकेले, विशाल ढेर में फेंक देता। अगर आप अपना main.c नामक program खोलना चाहते, system को disk की शुरुआत से हर दूसरे student की हज़ारों files scan करनी होतीं। system आपकी बिल्कुल file एक second से कम में कैसे खोजता है?

Theory

Supermarket Aisle Signs

एक directory system को एक mega supermarket के प्रवेश पर विशाल aisle signs की तरह सोचिए। signs physically biscuits, soaps, या electronics के boxes नहीं रखते। बजाय इसके, वे item categories की एक साफ़ सूची बिल्कुल shelf locations के साथ जोड़कर देते हैं। जब आप juice का एक ख़ास brand चाहते हैं, आप sign जाँचते हैं, aisle number पहचानते हैं, और सीधे वहाँ चलते हैं, सैकड़ों असंगत shelves को पूरी तरह bypass करते हुए।

Theory

Directory Systems परिभाषित

औपचारिक रूप से, एक directory system operating system द्वारा बनाए रखी गई एक ख़ास संरचनात्मक file है जो मानव पठनीय file names को उनके अनोखे system identifiers और physical storage locations से map करती है। इसके साथ, file management system OS का मूल subsystem है जो files create, delete, search, list, और protect करने के लिए functions देता है, user applications और physical disk sectors के बीच एक बिचौलिए के रूप में काम करते हुए।

At a glance

एक file management subsystem द्वारा सँभाली गई प्राथमिक ज़िम्मेदारियाँ।

मूल FunctionOS ज़िम्मेदारीLabOne उदाहरण
Directory Mappingfile names को system internal identifiers में अनुवादित करता हैstudent1.c को Inode 8841 से map करता है
File Operationscreation, deletion, और directory updates सँभालता हैrm lab1.c execute होने पर map reference साफ़ करता है
Access Controlअलग users के बीच permission नियम लागू करता हैStudent A को Student B directory के अंदर files modify करने से block करता है
Space Allocationtrack करता है कि कौन से disk blocks मुफ़्त या files द्वारा घेरे हैंजब आप एक नई text file save करते हैं तो 3 मुफ़्त disk blocks सौंपता है

Think first

एक File Lookup Sequence को ट्रेस करना

एक exam सवाल पूछता है: 'ट्रेस कीजिए कि एक operating system कौन से logical चरण उठाता है जब एक student LabOne पर studentA/project.py पर स्थित एक file पढ़ने की request करता है।' जवाब प्रकट करने से पहले चरण sequence मन में हल कीजिए।

Show the answer

Step 1: OS disk से master root directory पढ़ता है।

Step 2: यह root entries में folder name studentA खोजता है ताकि इसका अनोखा storage identifier मिले।

Step 3: system studentA की directory file को RAM में load करता है।

Step 4: यह इस subdirectory में file entry project.py के लिए scan करता है।

Step 5: यह project.py के लिए physical disk block addresses निकालता है और उन्हें पढ़ना शुरू करने के लिए disk driver को सौंपता है।

Quiz

एक आधुनिक operating system के अंदर एक directory की असल संरचनात्मक प्रकृति क्या है?

  1. motherboard पर एक समर्पित hardware chip
  2. name से identifier जोड़े रखती एक ख़ास file
  3. physical सीमा जहाँ data blocks ख़त्म होते हैं
  4. एक अस्थायी cache जो reboot पर ग़ायब हो जाता है
Show the answer

name से identifier जोड़े रखती एक ख़ास file

एक directory बस operating system द्वारा manage की गई एक ख़ास प्रकार की file है। user text या code store करने के बजाय, यह संरचनात्मक data store करती है, ख़ास तौर पर मानव पठनीय file names को internal system numbers या disk blocks से मिलाते जोड़े।

Watch out

Directory Content की ग़लतफ़हमी

university exams में एक classic ग़लती यह लिखना है कि एक directory अपने अंदर physically आपकी files की असल content bytes store करती है। अगर आप कहते हैं कि एक folder आपके assignment का text रखता है, आप marks खो देंगे। Examiners शब्द pointer या reference खोजते हैं। हमेशा साफ़ बताइए कि एक directory बस pointers का एक index है। असली data blocks disk storage tracks पर पूरी तरह अलग store होते हैं।

Think first

File Renaming का Mechanism

मान लीजिए आप LabOne पर command line इस्तेमाल करके lab1.c को final_lab.c में rename करते हैं। क्या operating system आपका सारा code hard drive पर एक नई जगह copy करता है? tap करने से पहले disk operation का विश्लेषण कीजिए।

Show the answer

नहीं, operating system शून्य data copying करता है। यह बस entry रखती directory file खोजता है, string lab1.c ढूँढता है, और उस ख़ास text field को final_lab.c में फिर से लिखता है। hard drive पर अंतर्निहित data blocks पूरी तरह अछूते रहते हैं, rename operation को file size के बावजूद तात्कालिक बनाते हुए।

Theory

Command Line और बाद के Semesters

आप इन functions के साथ हर बार जब एक terminal खोलते हैं बातचीत करते हैं। Unit 4 में, जब हम LabOne पर Linux install करते हैं, आप mkdir, rmdir, और ls जैसी commands इस्तेमाल करेंगे। ये standalone tools नहीं हैं: वे आज आपने सीखे file management functions के सीधे interfaces हैं। Semester 3 में Database Systems के तहत, आप देखेंगे कि database engines और भी तेज़ lookups के लिए OS को bypass करने के लिए अपनी ख़ुद की भीतरी custom directory indices कैसे बनाते हैं।

Summary

Key takeaways

  • एक directory system user के अनुकूल file names को internal system locations से map करते एक index के रूप में काम करता है।
  • File management functions creation, lookup, और deletion समेत files के पूरे lifecycle को सँभालते हैं।
  • Directories file data नहीं रखते, वे सिर्फ़ file metadata और pointers रखते हैं।
  • renaming जैसे operations सिर्फ़ directory text fields modify करते हैं, असली disk data blocks को हिलाए बिना।
  • file system LabOne जैसे साझा servers पर user अलगाव और access rights लागू करता है।
  • Memory hook: Directory नक़्शा है, file management driver है!

Study this properly

This page is the lesson to read. In Gri-Learn the same topic is a graded deck: the self-checks are scored and your weak topics are tracked. Free to start.

Start this topic

Already have an account? Sign in

More from File and Memory Management

Gri-Learn · syllabus-mapped B.C.A. lessons in English, Hindi and Gujarati

Directory Systems, File Management Functions · Operating System · Gri-Learn