;+ ; NAME: def_myuniquetmpdir ; ; PURPOSE: if needed, define and create myuniquetmpdir ; (common variable from cm_general) and add it to !path ; ; CATEGORY: utilities ; ; CALLING SEQUENCE:def_myuniquetmpdir ; ; COMMON BLOCKS: cm_general ; ; SIDE EFFECTS: see purpose ; ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) ; June 2005 ; ;- PRO def_myuniquetmpdir @cm_general ; IF n_elements(myuniquetmpdir) EQ 0 THEN BEGIN ; define a new and unique directory in getenv('IDL_TMPDIR') by using systime(1) ; look for the login if we use "unix" system IF !d.name EQ 'X' THEN spawn, 'whoami', login, /noshell ELSE login = 'idl' myuniquetmpdir = file_search(getenv('IDL_TMPDIR'), /mark_directory) myuniquetmpdir = myuniquetmpdir[0] + login[0] + '.' $ + strtrim(long(systime(1)), 1) + '/' ; create it file_mkdir, myuniquetmpdir ; add it to !path !path = !path+ ':' + expand_path(myuniquetmpdir) ENDIF ; return end