A good answer might be:

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

Usually all collections of data outside of main storage are organized into files. The job of keeping all this information straight is the job of the operating system. If the computer system is part of a network, keeping straight all the files on all the computers can be quite a task, and is the collective job of all the operating systems involved.

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.)