Changeset 69 for trunk/Utilities/isafile.pro
- Timestamp:
- 05/11/06 12:35:53 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Utilities/isafile.pro
r11 r69 26 26 ; /NEW:to specify that filename is a new file and that 27 27 ; 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 28 32 ; 29 33 ; RECURSIVE: performs recursive searching of directory hierarchies. … … 64 68 ;------------------------------------------------------------ 65 69 FUNCTION 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 67 72 ;------------------------------------------------------------ 68 73 CASE 1 OF … … 72 77 ENDCASE 73 78 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 74 85 ; 75 86 basename = file_basename(fileout) … … 81 92 ; 82 93 fileout = find(basename, iodirectory = dirname $ 83 , recursive = recursive, /unique, /firstfound, _extra = ex) 94 , recursive = recursive, /unique, /firstfound, ONLYPRO = onlypro $ 95 , ONLYNC = onlync, _extra = ex) 84 96 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) 86 98 if fileout EQ '' THEN RETURN, report('check/find file canceled') 87 99 ; check again everything... … … 94 106 IF size(dirname, /type) NE 7 THEN return, report('check/find file canceled') 95 107 fileout = find(basename, iodirectory = dirname $ 96 , recursive = recursive, /unique, /firstfound, _extra = ex) 108 , recursive = recursive, /unique, /firstfound, ONLYPRO = onlypro $ 109 , ONLYNC = onlync, _extra = ex) 97 110 ENDWHILE 98 111 ;
Note: See TracChangeset
for help on using the changeset viewer.