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

Last change on this file since 224 was 224, checked in by pinsard, 17 years ago

improvements/corrections of some *.pro headers

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