Changeset 152 for trunk/SRC/Utilities/find.pro
- Timestamp:
- 08/10/06 09:01:35 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Utilities/find.pro
r136 r152 24 24 ; activate this keyword to stop looking for the file as soon as we found one. 25 25 ; 26 ; @keyword IODIRECTORY {default= !path}26 ; @keyword IODIRECTORY {default=['.',!path]} 27 27 ; A scalar or array variable of string type, containing 28 28 ; directories names where we are looking for the file. … … 34 34 ; 35 35 ; @keyword LOOKALLDIR 36 ; activate to look for the file with a recursive search37 ; in iodir, homedir, !path + the DATA:TestsData directory if it exists.36 ; activate to look for the file (with a recursive search if needed) 37 ; in . iodir, homedir, !path + the DATA:TestsData directory if it exists. 38 38 ; 39 39 ; @keyword NOPRO … … 56 56 ; @keyword UNIQUE 57 57 ; activate to make sure that each element of the output vector is unique. 58 ; 59 ; @keyword TRYFIND 60 ; if the file was not found and this keyword is activated, find will call 61 ; itself with the keywords /LOOKALLDIR and /FIRSTFOUND to try to find 62 ; the file we are looking for. Note that if the file was found at the 63 ; first try this keyword as no effect (which is not the case with LOOKALLDIR) 58 64 ; 59 65 ; @keyword _EXTRA … … 106 112 , REPERTOIRE = repertoire, NOPRO = nopro, ONLYPRO = onlypro $ 107 113 , ONLYNC = onlync, UNIQUE = unique, FIRSTFOUND = firstfound $ 108 , LOOKALLDIR = LOOKALLDIR, _extra = ex114 , LOOKALLDIR = LOOKALLDIR, TRYFIND = tryfind, _extra = ex 109 115 ; define where we look for the file 110 116 ; … … 114 120 keyword_set(lookalldir):BEGIN 115 121 @cm_general 116 dirnames = [ iodir, homedir, !path]122 dirnames = ['./', iodir, homedir, !path] 117 123 tstdtadir= file_dirname(find('find', /onlypro), /mark_directory) 118 124 tstdtadir = (file_search(tstdtadir+'../../DATA/TestsData'))[0] … … 121 127 keyword_set(iodirectory): dirnames = iodirectory 122 128 keyword_set(repertoire): dirnames = repertoire 123 ELSE: dirnames = !path129 ELSE: dirnames = ['./', !path] 124 130 ENDCASE 125 131 tmp = dirnames … … 164 170 ENDIF 165 171 ENDFOR 172 166 173 IF n_elements(fileout) EQ 1 THEN fileout = 'NOT FOUND' $ 167 174 ELSE fileout = fileout[1:*] … … 171 178 ENDIF ELSE fileout = fileout[0] 172 179 ; 180 IF keyword_set(lookalldir) AND fileout[0] EQ 'NOT FOUND' $ 181 AND NOT keyword_set(recursive) THEN $ 182 filout = find(file_basename(filein[0]), /lookalldir $ 183 , /recursive, _extra = ex) 184 ; 185 IF keyword_set(tryfind) AND fileout[0] EQ 'NOT FOUND' THEN BEGIN 186 fileout = find(file_basename(filein[0]), /lookalldir, /firstfound, _extra = ex) 187 fileout = fileout[0] 188 ENDIF 189 ; 173 190 RETURN, fileout 174 191 END
Note: See TracChangeset
for help on using the changeset viewer.