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