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

Last change on this file since 128 was 128, checked in by pinsard, 18 years ago

improvements of Utilities/*.pro header

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