;; | --------------------------------------------------------------------------- ;; | MI_FindInComputer ;; | --------------------------------------------------------------------------- ;; | Function : Returns each occurence of the specified file on the entire ;; | computer as returned by the named drives. ;; | Argument : 'fn' - File Name to search ;; | 'flag' - Flag value to use for the (dos_find...) function ;; | 0 - None. ;; | 1 - Sorted alphabetically, ascending. ;; | 2 - Sorted alphabetically, descending. ;; | 3 - Sorted by date, ascending. ;; | 4 - Sorted by date, descending. ;; | 5 - Sorted by size, ascending. ;; | 6 - Sorted by size, descending. ;; | 'ExclRem' - If T, removable drives (like floppy drives) will be ;; | excluded from search. ;; | 'StopFirst' - Stop after first match is found ;; | Returns : A list of all matching finenames on the computer ;; | Updated : August 10, 2003 ;; | Comments : Uses DOSLIB 6.1 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | --------------------------------------------------------------------------- (defun MI_FindInComputer ( fn flag ExclRem StopFirst / Drive DriveLst FileLst _FileLst Ok More ) (setq FileLst '() DriveLst (dos_drives) More T ) (if DriveLst (progn (while More (setq Drive (car DriveLst) Ok T ) (if (and ExclRem (= (strcase (dos_drivetype Drive)) "REMOVABLE")) (setq Ok nil) ) (if Ok (progn (if (setq _FileLst (dos_find (strcat Drive "/" fn) flag)) (progn (setq FileLst (append FileLst _FileLst)) (if StopFirst (setq More nil) ) )) )) (setq DriveLst (cdr DriveLst)) (if (not DriveLst) (setq More nil) ) ) )) FileLst )