Your SlideShare is downloading. ×
0
File management module 7
File management module 7
File management module 7
File management module 7
File management module 7
File management module 7
File management module 7
File management module 7
File management module 7
File management module 7
File management module 7
File management module 7
File management module 7
File management module 7
File management module 7
File management module 7
File management module 7
File management module 7
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

File management module 7

355

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
355
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
37
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  1. File ManagementIf there is one singular characteristic that makes human unique amongothers it is their natural instinct to manage thingsProf. Hemang Kothari
  2. Motivation for file system• Applications can store it in the process address space• Why is it a bad idea?• Size is limited to size of virtual address space• May not be sufficient for airline reservations, banking, etc.• The data is lost when the application terminates• Even when computer doesn’t crash!• Multiple process might want to access the same data• Imagine a telephone directory part of one processProf. Hemang Kothari
  3. Motivation Continue .....• 3 criteria for long-term information storage:• Should be able to store very large amount of information• Information must survive the processes using it• Should provide concurrent access to multiple processes• Solution:• Store information on disks in units called files• Files are persistent, and only owner can explicitly delete it• Files are managed by the OS• File Systems: How the OS manages files!Prof. Hemang Kothari
  4. Files• Data collections created by users• Desirable properties of files:Long-term existence• Files are stored on disk or other secondary storage and do not disappear when a user logs offSharable between processes• Files have names and can have associated access permissions that permit controlled sharingStructure• Files can be organized into hierarchical or more complex structure to reflect the relationships amongfilesProf. Hemang Kothari
  5. File Naming• Motivation: Files abstract information stored on disk• You do not need to remember block, sector, …• We have human readable names• How does it work?• Process creates a file, and gives it a name• Other processes can access the file by that name• Naming conventions are OS dependent• Usually names as long as 255 characters is allowed• Digits and special characters are sometimes allowed• MS-DOS and Windows are not case sensitive, UNIX family isProf. Hemang Kothari
  6. File StructureFour terms arecommonly used whendiscussing files:Field Record File DatabaseProf. Hemang Kothari
  7. File StructureField• basic element of data• contains a single value• fixed or variable lengthDatabase• Collection of related data• Relationships among elements of data areexplicit• Designed for use by a number of differentapplications• Consists of one or more types of filesFile• Collection of similar records• Treated as a single entity• May be referenced by name• Access control restrictionsusually apply at the file levelRecord• Collection of related fields that can be treatedas a unit by some application program• One field is the key – a unique identifierProf. Hemang Kothari
  8. File Structure• Files can be structured as a collection of records or as asequence of bytes• UNIX, Linux, Windows, Mac OS’s consider files as a sequenceof bytes• Other OS’s, notably many IBM mainframes, adopt thecollection-of-records approach; useful for DB• COBOL supports the collection-of-records file and canimplement it even on systems that don’t provide such filesnatively.Prof. Hemang Kothari
  9. File Types – Name , ExtensionProf. Hemang Kothari
  10. File Access• Sequential access• Read all bytes/records from the beginning• Cannot jump around, could rewind or back up• Convenient when medium was magnetic tape• Random access• Bytes/records read in any order• Essential for many applications• Read can be …• move file pointer (seek), then read or …• read and then move file markerAll modern OS haveall files as randomaccessProf. Hemang Kothari
  11. File Attributes• File name• Size information• Physical address• File type• ASCII vs binary• Temporary vs Permanent• Access rights: owner, protection (who can access it)• Access type: Sequential/Random• History: Creator, time of last access/modification, other usage data• Info for managing linksProf. Hemang Kothari
  12. File Operation• Create• Delete• Open• Close• Read• Write• Append• Seek (lseek)• Get attributes– stat, lstat, fstat, fcntl• Set Attributes (fcntl)• RenameProf. Hemang Kothari
  13. DirectoriesProf. Hemang Kothari
  14. Single-Level Directory SystemsA single level directory system• Contains 4 files• Owned by 3 different people, A, B, and C• Ownerships are shown, not file namesProf. Hemang Kothari
  15. Two-level Directory SystemsProf. Hemang Kothari
  16. Hierarchical Directory SystemsProf. Hemang Kothari
  17. Path NamesA UNIX directory treeProf. Hemang Kothari
  18. Directory Operations1. Create2. Delete3. Opendir4. Closedir5. Readdir6. Rename7. Link8. UnlinkProf. Hemang Kothari

×