NOTE: This assignment, like the other projects in this class, is due at a particular time, listed above. This means that if you are even a minute late, you lose 20%. If you are worried about potentially being late, turn in your project ahead of time. Do this by submitting it electronically before it is due and giving the hard copy to me during office hours or by sliding it under my office door before it is due. Do not send assignments to my personal email address. Do not leave hard copies in my departmental mail box or attempt to give them to departmental staff (who cannot and will not accept them).
In your previous assignment, you took the first step toward the
development of an IDE by making use of existing editors, compilers, and
debuggers as components of MyDE
. However, MyDE Version
1.0
lacked some basic functionality we would want in an IDE, such as
presenting users with a list of files in the current directory that they
can edit.
In this assignment, you will take the second step toward the development of an IDE that you could use for projects written in C or C++. This is only the second step, since you have not yet learned in this class about mechanisms for passing the input and output of processes to one another (although you will!), and you are not assigned the job of creating a nice GUI front end for your IDE. Still, it will let you gain experience with the basic mechanisms for dealing with files, directories, and permissions.
You are to create a program called MyDE2
. When run,
MyDE2
will present the user with a simple main menu of
options:
For options 02 through 07, MyDE2
will behave according to
the specifications of MyDE
in your previous project.
If the user chooses option 01, MyDE2
will not prompt the
user for a string, as was done MyDE
. Instead,
MyDE2
will present the user with a simple menu of the C and
C++ files in the current working directory and let the user select one
based on this menu. The menu will precede each file name with a two digit
number, which the user will enter to select the file. (You do not need to
worry about a directory containing 100 or more C or C++ files.)
If the user chooses option 08, MyDE2
will present the user
with a simple menu consisting of the parent directory and all of the
subdirectories of the current working directory and let the user select
one based on this menu. The menu will precede each directory name with a
two digit number, which the user will enter to select the file. (You do
not need to worry about a directory containing 100 or more entries for
directories.)
If the user chooses option 09, MyDE2
will present the user
with a simple menu consisting of the files, directories, and symbolic links
in the current working directory and let the user select one based on this
menu. The menu will precede each name with a two digit number, which the
user will enter to select the files, directory, or symbolic link. (You do
not need to worry about a directory containing 100 or more files,
directories, and/or symbolic links.) When the user selects from this menu,
MyDE2
will present the user with information relating to the
selected file, directory, or symbolic link. In particular, it will show
the user the name of the owner, the name of the group, the current
permission mode (represented symbolically, not numerically), and the access
control list (if any) for the selected file, directory, or symbolic link.
It will then prompt the user for the new mode for the selected file,
directory, or symbolic link (which the user should give symbolically, not
numerically). When the user gives the new mode, MyDE2
will
change the mode of the selected file, directory, or symbolic link to the
new mode. If the user hits return without entering a new mode, the mode
should remain unchanged.
If the user chooses option 10, MyDE2
will behave the same
as if the user had chosen option 09, except that it will prompt the user
for the changes to the access control list for the selected file,
directory, or symbolic link, rather than its new mode. The syntax for
these changes should be the same as for the setfacl
utility.
If the user hits return without entering a change, the access control list
should remain unchanged.
You will turn in both a hard copy and an electronic copy of your assignment. Please follow the instructions on how to send electronic copies. Do not send them to my email address.
Both the hard copy and the electronic copy will contain a write-up plus
the source code for MyDE2
. The electronic copy will also
contain the executable of MyDE2
. The electronic copy of your
write-up should not be in a proprietary format (such as MS Word); it should
be either in plain ASCII text or in a portable format (such as Postscript
or PDF). Your source code for each MyDE2
should be in a
single file called MyDE2.c
(for C code) or
MyDE2.cxx
(for C++ code) and your executable code should be
called MyDE2
.
Your source code should be well structured and well commented. It should conform to good coding standards (e.g., no memory leaks, extraneous variables, type mismatches, or unused code).
Your write-up will include 1/2 to 1 page (roughly 80 characters per line, 50 lines per page) explaining the data structures and algorithms used in your code. This page limitation does not include figures used in your explanations, which are encouraged and may take up any amount of space. (The explanations do not remove the requirement that your code be well commented.)
You may write your program from scratch or may start from programs for which the source code is freely available on the web or through other sources (such as friends or student organizations). If you do not start from scratch, you must give a complete and accurate accounting of where all of your code came from and indicate which parts are original or changed, and which you got from which other source. Failure to give credit where credit is due is academic fraud and will be dealt with accordingly.
As noted in the syllabus, you are required to work on this programming assignment in a group of at least two people. It is your responsibility to find other group members and work with them. The group should turn in only one (1) hard copy and one (1) electronic copy of the assignment. Both the electronic and hard copies should contain the names and student ID numbers of all group members. If your group composition changes during the course of working on this assignment (for example, a group of five splits into a group of two and a separate group of three), this must be clearly indicated in your write-up, including the names and student ID numbers of everyone involved and details of when the change occurred and who accomplished what before and after the change.
Each group member is required to contribute equally to each project, as far as is possible. You must thoroughly document which group members were involved in each part of the project. For example, if you have three functions in your program and one function was written by group member one, the second was written by group member two, and the third was written jointly and equally by group members three and four, both your write-up and the comments in your code must clearly indicate this division of labor.