Ignore:
Timestamp:
05/11/06 12:35:53 (18 years ago)
Author:
smasson
Message:

debug + new xxx

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Utilities/isafile.pro

    r11 r69  
    2626;     /NEW:to specify that filename is a new file and that 
    2727;        we should check only its path 
     28; 
     29;     ONLYPRO:force to look only at file ending with .pro 
     30; 
     31;     ONLYNC:force to look only at file ending with .nc 
    2832; 
    2933;     RECURSIVE: performs recursive searching of directory hierarchies. 
     
    6468;------------------------------------------------------------ 
    6569FUNCTION isafile, filein, FILENAME = filename, IODIRECTORY = iodirectory $ 
    66                   , NEW = new, RECURSIVE = RECURSIVE, _extra = ex 
     70                  , NEW = new, RECURSIVE = RECURSIVE, ONLYPRO = onlypro $ 
     71                  , ONLYNC = onlync, _extra = ex 
    6772;------------------------------------------------------------ 
    6873  CASE 1 OF 
     
    7277  ENDCASE 
    7378  if size(fileout, /type) NE 7 THEN return, -1 
     79; 
     80  CASE 1 OF 
     81    keyword_set(onlypro): filter = '*.pro' 
     82    keyword_set(onlync): filter = '*.nc' 
     83    else: filter = '*' 
     84  ENDCASE 
    7485; 
    7586  basename = file_basename(fileout) 
     
    8192; 
    8293  fileout = find(basename, iodirectory = dirname $ 
    83                  , recursive = recursive, /unique, /firstfound, _extra = ex) 
     94                 , recursive = recursive, /unique, /firstfound, ONLYPRO = onlypro $ 
     95                 , ONLYNC = onlync, _extra = ex) 
    8496  WHILE fileout[0] EQ 'NOT FOUND' DO BEGIN 
    85     fileout = dialog_pickfile(path = dirname[0], _extra = ex) 
     97    fileout = dialog_pickfile(path = dirname[0], filter = filter, _extra = ex) 
    8698    if fileout EQ '' THEN RETURN, report('check/find file canceled') 
    8799; check again everything... 
     
    94106    IF size(dirname, /type) NE 7 THEN return, report('check/find file canceled') 
    95107    fileout = find(basename, iodirectory = dirname $ 
    96                    , recursive = recursive, /unique, /firstfound, _extra = ex) 
     108                   , recursive = recursive, /unique, /firstfound, ONLYPRO = onlypro $ 
     109                   , ONLYNC = onlync, _extra = ex) 
    97110  ENDWHILE 
    98111; 
Note: See TracChangeset for help on using the changeset viewer.