Presentation/Test Shell: Command Language Specification

The following commands will be used in the test files for this project:

      cd <name>

o    create a new file with the name <name>

o    Output: file <name> created

      de <name>

o    destroy the named file <name>

o    Output: file <name> destroyed

 

      op <name>

o    open the named file <name> for reading and writing; display an index value

o    Output: file <name> opened, index=<index>

 

      cl <index>

o    close the specified file <index>

o    Output: file <index> closed

 

      rd <index> <count>

o    sequentially read a number of bytes <count> from the specified file <index> and display them on the terminal

o    Output: <count> bytes read: <xx...x>

 

      wr <index> <char> <count>

o    sequentially write <count> number of <char>s into the specified file <index> at its current position

o    Output: <count> bytes written

 

      sk <index> <pos>

o    seek: set the current position of the specified file <index> to <pos>

o    Output: current position is <pos>

 

      dr

o    directory: list the names of all files and their lengths

o    Output: file0 <len0>,..., fileN <lenN>

 

      in <no_cyl> <no_surf> <no_sect> <sect_len> <disk_cont>

o    create a disk using the given dimension parameters and initialize it using the file <disk_cont> (copy of disk)

o    If file does not exist, create and open directory; output: disk initialized

o    If file does exist, open directory; output: disk restored

 

      sv <disk_cont>

o    close all files and save the contents of the disk in the file <disk_cont>

o    Output: disk saved

 

      If any command fails, output: error