#!/usr/local/bin/perl -w

#
# Read in 'students', create directories for each.
#


$file = "student_list";

open IN, "<", $file;

foreach (<IN>) {
	s/#.*$//;
	if (!/([^\s]+)/) { next }
	$name = $1;
	if (!(-e $name)) {
		print("Creating directory '$name'.\n");
		system("mkdir '$name'");
	}
	print("Setting permissions on '$name'.\n");
	system("fs sa -dir '$name' -acl '$name' rlidwk");
	system("fs sa -dir '$name' -acl system:anyuser l efros all jmccann all");
}

close IN;
