[Swift-commit] r6188 - in SwiftApps/modis: . bin

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Wed Jan 30 09:03:42 CST 2013


Author: davidk
Date: 2013-01-30 09:03:31 -0600 (Wed, 30 Jan 2013)
New Revision: 6188

Modified:
   SwiftApps/modis/bin/colormodis.sh
   SwiftApps/modis/demo
Log:
Let mktemp create temp files in the work directory instead of /tmp on systems where it's not available


Modified: SwiftApps/modis/bin/colormodis.sh
===================================================================
--- SwiftApps/modis/bin/colormodis.sh	2013-01-30 05:28:47 UTC (rev 6187)
+++ SwiftApps/modis/bin/colormodis.sh	2013-01-30 15:03:31 UTC (rev 6188)
@@ -7,10 +7,12 @@
 
 infile=$1
 outfile=$2
-tmp=`mktemp /tmp/modis.$USER.XXXXXX`
+
+# Create temp files in current directory since /tmp may not be available
+tmp=`mktemp -p . modis.$USER.XXXXXX`
 mv $tmp $tmp.tif
 tmp=$tmp.tif
-map=`mktemp /tmp/colormap.$USER.XXXXXX`
+map=`mktemp -p . colormap.$USER.XXXXXX`
 
 # Create color set
 

Modified: SwiftApps/modis/demo
===================================================================
--- SwiftApps/modis/demo	2013-01-30 05:28:47 UTC (rev 6187)
+++ SwiftApps/modis/demo	2013-01-30 15:03:31 UTC (rev 6188)
@@ -6,6 +6,7 @@
 NSELECT=12
 SITE=local
 WEBDIR=$HOME/public_html/geo
+MODISDIR=$PWD/data/modis/2002
 
 # Verify an argument is not null
 verify_not_null()
@@ -28,6 +29,7 @@
       -nselect) NSELECT=$2; verify_not_null nselect $NSELECT; shift ;;
       -site) SITE=$2; verify_not_null site $SITE; shift ;;
       -webdir) WEBDIR=$2; verify_not_null webdir $WEBDIR; shift ;;
+      -modisdir) MODISDIR=$2; verify_not_null modisdir $MODISDIR; shift ;;
       *) ;;
    esac
    shift
@@ -39,5 +41,4 @@
 echo webdir=$WEBDIR
 
 eval swiftrun -site $SITE modis.swift -landtype=$LANDTYPE -nfiles=$NFILES \
-	 -nselect=$NSELECT -modisdir=$PWD/data/modis/2002 \
-         -webdir=$WEBDIR
+	      -nselect=$NSELECT -modisdir=$MODISDIR -webdir=$WEBDIR




More information about the Swift-commit mailing list