[LON-CAPA-cvs] cvs: loncom /interface lonspreadsheet.pm /lonnet/perl lonnet.pm

matthew lon-capa-cvs@mail.lon-capa.org
Thu, 13 Feb 2003 22:22:01 -0000


matthew		Thu Feb 13 17:22:01 2003 EDT

  Modified files:              
    /loncom/interface	lonspreadsheet.pm 
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  Now define temp directory in lonnet.
  
  
Index: loncom/interface/lonspreadsheet.pm
diff -u loncom/interface/lonspreadsheet.pm:1.169 loncom/interface/lonspreadsheet.pm:1.170
--- loncom/interface/lonspreadsheet.pm:1.169	Thu Feb 13 16:57:48 2003
+++ loncom/interface/lonspreadsheet.pm	Thu Feb 13 17:22:01 2003
@@ -1,5 +1,5 @@
 #
-# $Id: lonspreadsheet.pm,v 1.169 2003/02/13 21:57:48 matthew Exp $
+# $Id: lonspreadsheet.pm,v 1.170 2003/02/13 22:22:01 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -262,7 +262,6 @@
     # Global directory configs
     #
     $sheet->includedir($r->dir_config('lonIncludes'));
-    $sheet->tmpdir($r->dir_config('lonDaemons').'/tmp/');
     #
     # Check user permissions
     if (($sheet->{'type'}  eq 'classcalc'       ) || 
@@ -524,18 +523,12 @@
 # Directories
 #
 my $includedir;
-my $tmpdir;
 
 sub includedir {
     my $self = shift;
     $includedir = shift;
 }
 
-sub tmpdir {
-    my $self = shift;
-    $tmpdir = shift;
-}
-
 my %spreadsheets;
 #my %loadedcaches;
 my %courserdatas;
@@ -2778,7 +2771,7 @@
         $ENV{'user.domain'}.'_spreadsheet_'.$self->{'usymb'}.'_'.
            $self->{'filename'};
     $fn=~s/\W/\_/g;
-    $fn=$tmpdir.$fn.'.tmp';
+    $fn=$Apache::lonnet::tmpdir.$fn.'.tmp';
     my $fh;
     if ($fh=Apache::File->new('>'.$fn)) {
         my %f = $self->formulas();
@@ -2797,7 +2790,7 @@
            $ENV{'user.domain'}.'_spreadsheet_'.$self->{'usymb'}.'_'.
            $self->{'filename'};
     $fn=~s/\W/\_/g;
-    $fn=$tmpdir.$fn.'.tmp';
+    $fn=$Apache::lonnet::tmpdir.$fn.'.tmp';
     my $fh;
     my %fo=();
     my $countrows=0;
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.328 loncom/lonnet/perl/lonnet.pm:1.329
--- loncom/lonnet/perl/lonnet.pm:1.328	Thu Feb 13 16:57:48 2003
+++ loncom/lonnet/perl/lonnet.pm	Thu Feb 13 17:22:01 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.328 2003/02/13 21:57:48 matthew Exp $
+# $Id: lonnet.pm,v 1.329 2003/02/13 22:22:01 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -76,7 +76,7 @@
    %libserv %pr %prp %metacache %packagetab %titlecache 
    %courselogs %accesshash $processmarker $dumpcount 
    %coursedombuf %coursehombuf %courseresdatacache 
-   %domaindescription %domain_auth_def %domain_auth_arg_def);
+   %domaindescription %domain_auth_def %domain_auth_arg_def $tmpdir);
 use IO::Socket;
 use GDBM_File;
 use Apache::Constants qw(:common :http);
@@ -3668,6 +3668,12 @@
           $packagetab{$short}=$plain; 
        }
     }
+}
+
+# ------------- set up temporary directory
+{
+    $tmpdir = $perlvar{'lonDaemons'}.'/tmp/';
+
 }
 
 %metacache=();