[LON-CAPA-cvs] cvs: loncom / lond

raeburn lon-capa-cvs@mail.lon-capa.org
Tue, 14 Sep 2004 20:15:23 -0000


raeburn		Tue Sep 14 16:15:23 2004 EDT

  Modified files:              
    /loncom	lond 
  Log:
  Guy's changes from 8/30 to create directory structure in user's userfile area (for portfolio).
  
  
Index: loncom/lond
diff -u loncom/lond:1.256 loncom/lond:1.257
--- loncom/lond:1.256	Tue Sep 14 08:08:54 2004
+++ loncom/lond	Tue Sep 14 16:15:22 2004
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.256 2004/09/14 12:08:54 albertel Exp $
+# $Id: lond,v 1.257 2004/09/14 20:15:22 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -57,7 +57,7 @@
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.256 $'; #' stupid emacs
+my $VERSION='$Revision: 1.257 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid="default";
 my $currentdomainid;
@@ -2091,7 +2091,15 @@
 	if (-e $udir) {
 	    my $newdir=$udir.'/userfiles/'.$ufile;
 	    if (!-e $newdir) {
-		mkdir($newdir);
+		my @parts=split('/',$newdir);
+		my $path;
+		foreach my $part (@parts) {
+		    $path .= '/'.$part;
+		    if (!-e $path) {
+			&logthis("Making $path");
+			mkdir($path,0770);
+		    }
+		}
 		if (!-e $newdir) {
 		    &Failure($client, "failed\n", "$cmd:$tail");
 		} else {