Each student group will be assigned a unix "group ID", e.g.
401z, and a directory will be created for you in
/projects/instr/01sp/cse401/401z. Use this directory to
hold files you need to share with your group-mates. Remember
that files you create here need to be made "group readable"
and/or "group writable", but should not have "world" access.
tahiti% cd /projects/instr/01sp/cse401/
tahiti% ls -lg
drwxrwx--x 3 root 401a 512 Apr 11 20:04 401a/
drwxrwx--x 4 root 401z 512 Apr 11 17:21 401z/
tahiti% cd 401z
tahiti% cp ~/foo.c foo.c
tahiti% ls -lg
-rw------- 1 ruzzo 401z 7 Apr 12 20:41 foo.c
tahiti% ### Add read, write, exec/search to group, remove from others:
tahiti% chmod g+rwX,o-rwx *
tahiti% ls -lg
-rw-rw---- 1 ruzzo 401z 7 Apr 12 20:41 foo.c
RCS Access control
It is highly recommended that you use RCS ("Revision Control
System") to control simultaneous access and to provide a version
history. If you don't, then you risk having large portions of
your work disappear when one of your partners writes over the
same file you were working on. Very briefly, using RCS involves
registering all files in your project and then checking them out
to use them, and checking them in when finished.
Here's one way that you can set up your directory for version control.
Thanks to Ben Wong for a preliminary version of this info.
- Create a directory called RCS in your group's project
directory, and a symbolic link to it from your working directory:
ln -s /projects/instr/01sp/cse401/401z/RCS RCS
- Get the base project files:
cp -r /cse/courses/cse401/CurrentQtr/pl0 ~/myfavoritecourse/pl0
- Register all the files with RCS.
foreach foo (*)
ci -u -t-$foo $foo
You only need to do this once for each file. If you create
a new file you should check it via the ci line above or
clicking on Tools->Version Control->Register
- The procedure above will leave you with a read-only copy
of each file. To edit a file, say
you need to "check out" a "locked" copy of it, then check it
back in when you're finished.
co -l scanner.c
<...edit & test to your heart's content...>
ci -u scanner.c
Alternatively, it's easy to check files in and out using
emacs; simply visit the file and then hit C-x C-q (control-x
control-q). (Use the menus if you forget). Note that if
you haven't registered the file, the emacs mode-line won't
say RCS and C-x C-q will simply toggle the read-only status
of the file.
If you try to check out a file that someone's already using,
RCS and/or emacs will let you know who. Otherwise, it will
give you the lock to the file and nobody else will be able
to check out that file until you check it back in.
- RCS itself will not automatically give your partners a
file that you check back in. This is a feature; they can
choose when they want to synchronize their files with the
master versions. (For example, if they know that you've
checked in a buggy module that can't yet compile, but they
still want to keep working on their own part which isn't
dependent on it.)
If you want to make sure that all of your files are the most
current versions, you can run:
Alternatively, the following may work on some systems:
- Some hints:
- Try not to check-in a module that won't compile. Your
partners will be irked if they synchronize their files
and find they can't work on their own modules until you
fix yours. (If it helps, you can check out a previous
version if this happens to you; see
- To read about emacs's interface to RCS, type this within
C-h i g (emacs)Version Control
You can click on the hypertext links with the middle-button.
- Split separate modules into different files so that your
partners can work on other routines simultaneously.
- Make Version Snapshots often. That makes RCS remember not
just the state one file is in, but the state that all of
the files are in. Emacs allows you to take a snapshot by
typing either M-x vc-create-snapshot, or C-x v s.
- Here's a way to bump all version numbers to a
fixed value (maybe there's a better way):
co -l whatever-path-you-need-to-RCS/*,v
ci -f5.0 -m"base code for hw #5" whatever-path-you-need-to-RCS/*,v
the co locks current versions of everything; the ci puts
them back. -f forces deposit even though no changes,
setting version to 5.0; -m"blah" sets the same log
message for each; using path ...RCS/*,v means you will
ONLY check out/in stuff thats already under RCS control,
so you don't accidentally check in, e.g. your core and
- To read about RCS, take a look at man rcsintro, rcs,
ci, co, rsync, rlog, and rcsdiff.
CVS Access control
I don't know much about this, but various people have suggested
"CVS" as a newer, better alternative to RCS, and suggested this
tutorial. Feel free to explore it. Please let us know
whether you like it, or if you find other good references.
Department of Computer Science & Engineering|
University of Washington
Seattle, WA 98195-2350
(206) 543-1695 voice, (206) 543-2969 FAX
[comments to cse401-webmaster]