COP 3530 - Fall 2001 - Program 2 In this program, we will develop a simulated directory-file name storage system. Here are the operators: md() creates a new subdirectory with given name in the current directory cd() change current directory to rd() remove directory called and delete all of its contents rn() rename command save() save file named fname in current dir attrib(, ); set 's attribute string to cmd-str (check for valid chars). del() remove file named from cur dir copy(, , ) make a copy of the file info for in new dir (default uses same , option uses new name. move(, , ) make a copy of file called in and remove copy from orig. dir find(,) report on existence of file or dir with given name by displaying the complete path, otherwise display "file not found". Whenever you encounter this command, pause execution and ask me to hit any key to continue. dir(,) list contents of directory. opt-cmds are A (for all) S (for recurse through subdirectories). Without A, do not list hidden files. Each file/directory should be listed on one line along with its attribute string. Whenever you encounter this command, pause execution and ask me to hit any key to continue. Your directory will be a tree rooted in the "MYCOMP" node. Each entry will contain the 8 char name, the 3 char extension, and an attribute string (up to 5 characters long). Attribute string may contain the following characters: F for file S for system H for hidden R for read only D for directory Duplicate names will not be allowed in any single directory by your system but may occur in different directories. Your system must be able to read a command file and construct a corresponding file system tree. Tree structure details: Each tree node will contain data plus four references. The references will be: left-most child, right-sibling left-sibling parent Sample command file: md C cd C md TEMP cd TEMP save GEORGE save HENRY.TXT save HENRY.DOC rn GEORGE GEORGE.JPG attrib GEORGE.JPG H cd C save BILL.JPG move C C\TEMP\GEORGE.JPG copy C C\TEMP\HENRY.TXT Tree at this point will look like: MYCOMP | C | TEMP --- BILL.JPG --- GEORGE.JPG(H) --- HENRY.TXT | HENRY.TXT --- HENRY.DOC dir C *.* S (this is next line in input file) Output will be C (DIR) TEMP (DIR) HENRY.TXT (FILE) HENRY.DOC (FILE) BILL.JPG (FILE) HENRY.TXT (FILE) dir C *.* AS (this is next line in input file) Output will be C (DIR) TEMP (DIR) HENRY.TXT (FILE) HENRY.DOC (FILE) BILL.JPG (FILE) GEORGE.JPG (HIDDEN FILE) HENRY.TXT (FILE) find HENRY.TXT (this is next line in input file) Output will be C:\HENRY.TXT C:\TEMP\HENRY.TXT quit (this is the last line in the input file - just tell me to hit any key to quit and when I do you exit your program.) TREE NODE STRUCTURE outline: ref Parent (Parent ref) TreeNode (Left-most child ref) Data: Name (string8) Ext (string3) Atb (string5) ref RSib (Right sib ref) ref LSib (Left sib ref) For the final node representing GEORGE.JPG Parent is ref to C TreeNode is null Name is GEORGE Ext is JPG Atb is FH RSib is ref to HENRY.TXT node LSib is ref to BILL.JPG node For the final node representing TEMP Parent is ref to C node TreeNode is ref to HENRY.TXT Name is TEMP Ext is null string Atb is D RSib is ref to BILL.JPG LSib is null Save your main class under the name MY_FS.java Ask for the name of the input command file. Due date: October 14, 2001