P2 : Python

Finding Duplicate Filenames


Objectives


Description

In this assignment, you are going to write a small program in Python that uses a type called a dictionary which is basically an associative array.


Specification

The purpose of this program is to produce a table listing all the unique filenames that occur in a set of directories which are entered from the keyboard. For each filename, you need to store a list of all the directories that contain that file.


Testing

Download or copy from the directory on onyx the following files:

the testDirs directory has some directories with sometimes duplicated files which you can run your program on. You can make a symbolic link to testDirs by typing

ln -s ~tcole/teaching/cs354/handouts/p2/testDirs
Be sure the first line of your program has the line
#!/usr/bin/python
in it and then make your program executable by typing
chmod +x filelist.py
Now you can run the test script by typing
./testProg

FYI: testProg is a shell script written in bash. You should be able to tell what it does by reading the file in an editor or listing it to the screen with the cat command.


Submission

Required files

Be sure the filenames match exactly. I use a test script to run the programs; if it doesn't find the files it expects, you will automatically lose 5% of the points for the assignment.

Put all the required files for the assignment in a single directory, change to that directory and submit using the following command:

submit tcole cs354 2