File management refers to the ability to read and modify files on storage devices and to create and delete files. Storage devices like hard drives are divided into tracks and sectors, and a single file that occupies many sectors could be spread all over a disk. This fragmentation makes accessing a file tricky. Fortunately for application programmers, locating the fragments of a file are the responsibility of the operating system.
Each storage device has both a logical and physical structure. The logical structure is what the user sees. Consider a small file stored on a Windows operating system under the name C:\MyDocuments\Myfile.txt. Here, Myfile.txt is the name of the file, and C:\MyDocuments is the file's logical location. On a Windows system, it means that the file is on a hard drive indicated by the letter C and that on that drive it is stored in a folder called "My Documents."
Each file is stored across various sectors on a disk. The logical structure and physical structure are not related. Just because two files are located in the same folder, for example, does not mean they are anywhere near each other on the physical storage device.
Thus, a primary job of file management is mapping logical file locations to physical locations. To do this, the operating system maintains a directory on each storage device. The directory lists which physical locations go with which files and also keeps track of which locations on the storage device are free, that is, that are not currently used by any file.
As files grow and shrink, and are created and deleted, the operating system changes the directory to reflect how the sectors are currently used. This file management allows all the application programs to deal exclusively with the logical file structure.
Note that the operating system will generally cache files. The CPU has a cache, which is a small amount of RAM that can hold recently used data close by, so if it's needed again soon, the request doesn't have to go all the way to main memory. Similarly, the operating system may hold recently accessed file data in main memory—so if it's needed again, the request doesn't have to go back to the storage device.
Or, if a program has requested the first fifty bytes from a file, the operating system may go ahead and retrieve several kilobytes or more from the file in anticipation of a later request. This process is another form of caching.
Certain utility programs must integrate themselves with the operating system to function. A good example is a program that scans files for viruses before they are used. If you are in a word processing program and ask the program to open a file, that file must pass through the virus scanner on its way from the operating system to the word processor. To allow these kinds of utilities to function, the operating system must provide "hooks."
A hook is a request for the operating system to invoke another program for a certain operation. The virus scanning program establishes a hook that says, "Whenever you are opening a file, call me first."
A few years ago many were complaining that Microsoft's dominance of the operating system market gave it an unfair advantage when it came to writing applications. One of the accusations was that because Microsoft had more intimate knowledge of the operating system, Microsoft developers could write software that relied on undocumented hooks, giving their programs abilities others could not match.
Our website is not responsible for the information contained by this article. Webworldarticles.com is a free articles resource thus practically any visitor can submit an article. However if you notice any copyrighted material, please contact us and we will remove the article(s) in discussion right away.
This article was sent to us by:
Brendan Stonker at
02122011
1. Expected battery life and charging times for an iPod Touch
All articles in this directory are property of their respective authors. Additionally, read our Privacy Policy
© 2010 WebWorldarticles.com - All Rights Reserved. Partners: Gunblade Saga