CSE 321: Managing Your Project Directory


You and your partner have been provided a project directory. This is shared directory space that is accessible to both of you, but no one else. All your team assignments (closed labs and labs) should be done in this directory.

To find out what your team directory is, type

groups
You will see (among other things) c321axnn, where "x" is your section letter and "nn" is the number of your team. Your project directory is /project/c321axnn.

Copying an Assignment

Only one of the partners needs to copy an assignment. We will call him partner 1:

Sharing Files

The only appropriate way of sharing files with your partner is through the team directory. Do not store team files in your personal directory and give your partner access to your account. This may be considered Academic Misconduct.

Remember that there is only one copy of the assignment in the team directory. Partners are responsible for coordinating who will access the files when and to ensure that the other partner has access to all the files and directories under the group directory.

Whenever you create files in the team directory, you should check to see that your partner has permission to access the file. For example, if you use emacs to create a testfile, you will want to make that file readable for your partner so he can use it to test the assignment. The ls -al command is used to show the permissions on all the files in the current directory. The chmod command is used to change permissions.

Understanding File Permissions

The command "ls -al" will show you the permissions on the files, eg:
% ls -al
total 40
drwxrwx---   2 lohse    c321aa00    512 Jun  3 15:41 .
drwxrwx---   3 lohse    c321aa00    512 Jun  3 15:41 ..
-rw-rwx---   1 lohse    c321aa00   5373 Jun  3 15:41 Kernel_2.h
-rw-rwx---   1 lohse    c321aa00   4383 Jun  3 15:41 Kernel_2_Body.h
-rw-rwx---   1 lohse    c321aa00   2528 Jun  3 15:41 Kernel_2a.h
-rw-rwx---   1 lohse    c321aa00    804 Jun  3 15:41 Kernel_2a_Body.h
-rw-rwx---   1 lohse    c321aa00   1320 Jun  3 15:41 Kernel_2a_C.h
-rw-rwx---   1 lohse    c321aa00    789 Jun  3 15:41 Kernel_2a_C_Body.h

1234567891
         0 -- the first ten column positions indicate the permission status
The first character (in column 1) will be a 'd' for directory, or a '-' for file.

Then there are three groups of three characters:

the first group (positions 2,3,4) indicate persmissions for the owner of the file (in this example lohse)
the second group (positions 5,6,7) indicate permissions for the group of this file (in this example c321aa00)
the third group (positions 8,9,10) indicate permissions for others (everyone else)
Within a group:
the first character is an 'r' if read permission is allowed, '-' if it is not
the second character is an 'w' if write permission is allowed, '-' if it is not
the third character is an 'x' if execute permission is allowed '-' if it is not. (sometimes the third character is an 's' for execute permission)
So in this example, all files are readable and writeable by the owner (lohse) [rw-]; readable, writable and executable by anyone in group c321aa00 [rwx] and not accessible at all to anyone else [---]. To change a permission, the chmod command is used. For example, if a file looked like :
-rw------   1 lohse    c321aa00   5373 Jun  3 15:41 sample
and the owner wanted to give group members read permission, the command would be:
chmod g+r sample
(the "g" stands for group the "+r" for add read permission)

To give all permissions to the group, use

chmod g+rwX sample
To give all permissions to the group for all files in the directory, use
chmod g+rwX *
To take away permissions, use "-" instead of "+". For example to prevent group members from changing file sample, take away write permission:
chmod g-w sample