source: trunk/SRC/Utilities/def_myuniquetmpdir.pro @ 114

Last change on this file since 114 was 114, checked in by smasson, 18 years ago

new compilation options (compile_opt idl2, strictarrsubs) in each routine

  • Property svn:executable set to *
File size: 954 bytes
Line 
1;+
2; @file_comments if needed, define and create myuniquetmpdir
3; (common variable from cm_general) and add it to !path
4;
5; @categories utilities
6;
7; @examples
8; IDL> def_myuniquetmpdir
9;
10; @uses cm_general
11;
12; @history Sebastien Masson (smasson\@lodyc.jussieu.fr)
13;                      June 2005
14;
15;-
16PRO def_myuniquetmpdir
17;
18  compile_opt idl2, strictarrsubs
19;
20@cm_general
21;
22 IF n_elements(myuniquetmpdir) EQ 0 THEN BEGIN
23; define a new and unique directory in getenv('IDL_TMPDIR') by using systime(1)
24; look for the login if we use "unix" system
25    IF !d.name EQ 'X' THEN spawn, 'whoami', login, /noshell ELSE login = 'idl'
26    myuniquetmpdir = file_search(getenv('IDL_TMPDIR'), /mark_directory)
27    myuniquetmpdir = myuniquetmpdir[0] + login[0] + '.' $
28                  + strtrim(long(systime(1)), 1) + '/'
29; create it
30    file_mkdir, myuniquetmpdir
31; add it to !path
32    !path = !path+ ':' + expand_path(myuniquetmpdir)
33  ENDIF
34;
35
36  return
37end
Note: See TracBrowser for help on using the repository browser.