;********************************************* ; Bugs: wildcards should be allowed (weren't working) ; ; Should deal with insufficent access and bad ; pathnames (for AppleShare) ;********************************************* ; ; External command for Davex ; ; ffind -- locate files by name, type, auxtype, etc ; ; ffind [] [-n ] [-f ] ; [-x ] [-e] [-q] [-p] [-d] [-b y|n] ; [-o ] [-s ] [-i y|n] ; ; path --where to look (omit-->scan all volumes) ; -n --name to match ; -f --filetype to match ; -x --auxiliary type to match ; -e --name match must be exact ; -q --query "continue searching?" ; -p --set prefix to dir containing match ; -d --detail (print type, auxtype) ; -o --output string template ; -b y|n --find if backup bit set ; -i y|n --find if invisible ; -s --find specific storage type ; ;********************************************* ; ; 11-Jun-89 DAL ==> v1.2 ; -i and -s options added ; -d sense reversed (now means NO detail) ; ;********************************************* ; ; Converted to MPW IIgs 20-Sep-92 DAL ; ;********************************************* .include "Common/2/Globals2.asm" .include "Common/2/Apple.Globals2.asm" .include "Common/2/Mli.globals2.asm" .include "Common/Macros.asm" ; .segment "CODE_A000" OrgAdr = $A000 ;change as necessary (end below $B000) ; org OrgAdr MyVersion = $12 MinVersion = $12 MinVerAux = $05 ;v1.25+ ;********************************************* rts .byte $ee,$ee .byte MyVersion,MinVersion .byte %00000000 ;hardware req .addr descr .addr OrgAdr .addr start .byte MinVerAux,0,0,0 ; parameters here .byte 0,t_path ;where to look .byte $80+'n',t_string ;what to look for .byte $80+'p',t_nil ;set prefix when found .byte $80+'e',t_nil ;exact matches only .byte $80+'f',t_ftype ;certain filetype only .byte $80+'x',t_int2 ;certain auxtype only .byte $80+'q',t_nil ;query .byte $80+'o',t_string ;output string format .byte $80+'d',t_nil ;detail .byte $80+'b',t_yesno .byte $80+'i',t_yesno .byte $80+'s',t_int1 .byte 0,0 descr: pstr "locate files by name/type/auxtype/etc" ;********************************************* ; dum xczpage ;32 locations str = xczpage ;ds 2 path = str+2 ;ds 2 out = path+2 ;ds 2 no_exact = out+2 ;ds 1 ;exact-match flag no_query = no_exact+1 ;ds 1 ;query flag temp_ch = no_query+1 ;ds 1 str_len = temp_ch+1 ;ds 1 startpos = str_len+1 ;ds 1 count = startpos+1 ;ds 1 exit_flag = count+1 ;ds 1 specialMark = exit_flag+1 ;ds 1 ; dend pathbuff = OrgAdr-$100 ;******************************* start: sta path+1 sty path lda #'q'+$80 jsr xgetparm_ch ror no_query lda #'e'+$80 jsr xgetparm_ch ror no_exact lda #0 sta direcpath sta exit_flag ldy #0 lda (path),y beq all_units lda path+1 ldy path jmp find_ay all_units: ldx #0 one_u: txa pha lda unit_list,x jsr find_on_unit pla tax inx cpx #$0E bcc one_u rts unit_list: .byte $10,$90,$20,$A0,$30,$B0,$40,$C0 .byte $50,$D0,$60,$E0,$70,$F0 find_on_unit: sta onl_unit jsr mli .byte mli_online .addr online_parms bcc good_unit rts online_parms: .byte 2 onl_unit: .res 1 .addr pathbuff+1 good_unit: lda pathbuff+1 and #$0f tax inx stx pathbuff lda #'/' sta pathbuff+1 ; jsr xpmgr .byte pm_downcase .addr pathbuff ; lda #>pathbuff ldy #catbuff ldy #