source: trunk/Utilities/def_myuniquetmpdir.pro @ 11

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

upgrade of UTILITAIRE/Utilities according to cerbere.lodyc.jussieu.fr: /usr/home/smasson/SAXO_RD/ : files

  • Property svn:executable set to *
File size: 995 bytes
Line 
1;+
2; NAME: def_myuniquetmpdir
3;
4; PURPOSE: if needed, define and create myuniquetmpdir
5;          (common variable from cm_general) and add it to !path
6;
7; CATEGORY: utilities
8;
9; CALLING SEQUENCE:def_myuniquetmpdir
10;
11; COMMON BLOCKS: cm_general
12;
13; SIDE EFFECTS: see purpose
14;
15; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr)
16;                      June 2005
17;
18;-
19PRO def_myuniquetmpdir
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.