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

Last change on this file since 192 was 157, checked in by navarro, 18 years ago

header improvements + xxx doc

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