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

Last change on this file since 311 was 311, checked in by smasson, 17 years ago

bugfix for unix system whitout whoami

  • Property svn:keywords set to Id
File size: 1.0 KB
RevLine 
[11]1;+
[231]2;
[128]3; @file_comments
4; if needed, define and create myuniquetmpdir
[93]5; (common variable from cm_general) and add it to !path
[11]6;
[157]7; @categories
8; Utilities
[11]9;
[128]10; @examples
[93]11; IDL> def_myuniquetmpdir
[11]12;
[224]13; @uses
14; cm_general
[11]15;
[224]16; @history
17; Sebastien Masson (smasson\@lodyc.jussieu.fr)
[11]18;                      June 2005
19;
[224]20; @version
21; $Id$
[118]22;
[11]23;-
[231]24;
[11]25PRO def_myuniquetmpdir
[114]26;
27  compile_opt idl2, strictarrsubs
28;
[11]29@cm_general
30;
[311]31  IF n_elements(myuniquetmpdir) EQ 0 THEN BEGIN
[11]32; define a new and unique directory in getenv('IDL_TMPDIR') by using systime(1)
[311]33; if possible, look for the login to make a more explicite name
34    IF file_which(getenv('PATH'), 'whoami') ne '' THEN spawn, 'whoami', login, /noshell ELSE login = 'unknown'
[11]35    myuniquetmpdir = file_search(getenv('IDL_TMPDIR'), /mark_directory)
[311]36    myuniquetmpdir = myuniquetmpdir[0] + 'saxo_' + login[0] + '.' $
37                     + strtrim(long(systime(1)), 1) + '/'
[11]38; create it
39    file_mkdir, myuniquetmpdir
40; add it to !path
[239]41    !path = myuniquetmpdir + path_sep(/search_path) + !path
[11]42  ENDIF
43;
44
45  return
46end
Note: See TracBrowser for help on using the repository browser.