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

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

add $ in Calendar, Grid, Interpolation, Obsolete and Postscript *.pro files, add svn:keywords Id to all these files, some improvements in header

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