rudimentary java library beginning. cleaned up scripts quite
[feisty_meow.git] / scripts / core / create_tempdir.sh
1 #!/bin/bash
2
3 # create_tempdir:
4 #
5 # This creates a temporary directory for transient files if such a directory
6 # does not already exist.
7
8 if [ ! -z "$SHELL_DEBUG" ]; then echo creating temporary directory...; fi
9
10 if [ -z "$TMP" ]; then
11   export TMP=$HOME/.tmp
12     # main declaration of the transients area.
13   if [ "$OS" = "Windows_NT" ]; then
14     export TMP=c:/tmp
15   fi
16 fi
17
18 LOG_FILE=$TMP/zz_transients.log
19   # log file for this script.
20
21 word=Verified
22 if [ ! -d "$TMP" ]; then
23   mkdir $TMP
24   word=Created
25 fi
26 if [ -z "$LIGHTWEIGHT_INIT" ]; then
27   echo "$word transient area \"$TMP\" for $USER on $(date_stringer)." >>$LOG_FILE
28 fi
29
30 # set other temporary variables to the same place as TMP.
31 export TEMP=$TMP
32
33 # Make sure no one else is playing around in the temporary directory.
34 chmod 700 $TMP
35
36 if [ ! -z "$SHELL_DEBUG" ]; then echo done creating temporary directory....; fi
37