go to previous page   go to home page   hear noise   go to next page

Answer:

Usually in a file in secondary storage. If the file does not already exist, the program will ask the operating system to create it.

Files and the Operating System

Most collections of data outside of main storage are organized into files. Keeping track of all this information is one of the jobs of the operating system. If the computer is part of a network, keeping track of all the files on all the computers is a big job, and involves all the operating systems on the network.

Application programs (including programs that you might write) do not directly read, write, create, or delete files. Since the operating system has to keep track of everything, all other programs ask it to do file manipulation tasks. For example, say that a program has just calculated a set of numbers and needs to save them. The following might be how it does this:

  1. Program: asks the operating system to create a file with a name RESULTS.DAT
  2. Operating System: gets the request; finds an unused section of the disk and creates an empty file. The program is told when this has been completed.
  3. Program: asks the operating system to save the numbers in the file.
  4. Operating System: gets the numbers from the program's main memory, writes them to the file. The program is told when this has been completed.
  5. Program: continues on with whatever it is doing.

So when an application program is running, it is constantly asking the operating system to perform file manipulation tasks (and other tasks) and waiting for them to be completed. If a program asks the operating system to do something that will damage the file system, the operating system will refuse to do it. Modern programs are written so that they have alternatives when a requests is refused. Older programs were not written this way, and do not run well on modern computers.

QUESTION 13:

In modern computer systems, only the operating system can directly do anything with disk files. How does this:

  1. affect the security of the system?
  2. affect computer games?
  3. affect the ease in creating programs?

(You might not be certain about your answers, but please think about the questions.)