;+ ; @file_comments ; if needed, define and create myuniquetmpdir ; (common variable from cm_general) and add it to !path ; ; @categories utilities ; ; @examples ; IDL> def_myuniquetmpdir ; ; @uses cm_general ; ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) ; June 2005 ; ; @version $Id$ ; ;- PRO def_myuniquetmpdir ; compile_opt idl2, strictarrsubs ; @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