Basic File Operations Review  

  The following review questions were covered in Labs 02 and 03 and are questions taken from the course website. NOT ALL questions from the course website were discussed in lab.
Please note that the information presented here does not necessarily represent a complete answer to the review question. The information is intended to spark student's memory for those who attended lab OR provide a base (hint) from where to start for those students who did not attend lab.


  Question 1: Distinguish between move mode and locate mode methods of buffering I/O and name one advantage of each?  
    MOVE MODE physicallly moves blocks in and out of buffer
Advantage: Secure
Disadvantage: Slower

LOCATE MODE references data in buffer
Advantage: Fast Access
Disadvantage: Insecure
 

  Question 2: Name two reasons for buffering I/O ourselves in a program written on UNIX?  
   
FLEXIBILITY and CONTROL
 

  Question 3: Suppose we have a list of records in memory and we want to see how many of those records also appear in a large file stored on dis. Should we start with:
A) the first revord in memory and check it against all the records in the file and then move on to the second, etc.
B) the first revord from the file and check it against all the records in memory, and then read the second record, etc.
WHY?
 
    B) Because this approach means we will only pull each record from disk once. In terms of time, moving a record between disk and main memory is expensive and so we want to minimize the number of disk accesses.
 

  Question 4: Compare disk vs. RAM in terms of storage/access?  
   
DISK - larger capacity, permanent storage, slow access, less frequent access
RAM - smaller capacity, volatile storage, fast access, frequent access
 


BACK

© Copyright 2002
Questions? Please Email: gwen@cpsc.ucalgary.ca
Last modified October 5, 2002