Changeset 311


Ignore:
Timestamp:
11/16/07 12:52:46 (17 years ago)
Author:
smasson
Message:

bugfix for unix system whitout whoami

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Utilities/def_myuniquetmpdir.pro

    r239 r311  
    2929@cm_general 
    3030; 
    31  IF n_elements(myuniquetmpdir) EQ 0 THEN BEGIN 
     31  IF n_elements(myuniquetmpdir) EQ 0 THEN BEGIN 
    3232; define a new and unique directory in getenv('IDL_TMPDIR') by using systime(1) 
    33 ; look for the login if we use "unix" system 
    34     IF !d.name EQ 'X' THEN spawn, 'whoami', login, /noshell ELSE login = 'idl' 
     33; if possible, look for the login to make a more explicite name 
     34    IF file_which(getenv('PATH'), 'whoami') ne '' THEN spawn, 'whoami', login, /noshell ELSE login = 'unknown' 
    3535    myuniquetmpdir = file_search(getenv('IDL_TMPDIR'), /mark_directory) 
    36     myuniquetmpdir = myuniquetmpdir[0] + login[0] + '.' $ 
    37                   + strtrim(long(systime(1)), 1) + '/' 
     36    myuniquetmpdir = myuniquetmpdir[0] + 'saxo_' + login[0] + '.' $ 
     37                     + strtrim(long(systime(1)), 1) + '/' 
    3838; create it 
    3939    file_mkdir, myuniquetmpdir 
Note: See TracChangeset for help on using the changeset viewer.