Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Second request for help: globbing on a block of filenames Re:(3)

From: jkinraid:clear at: 9-Sep-2000 15:03

Hi,
> Oops, it occurs to me that I forgot to add the tail refinement to my first > find (meaning a file feeder~fodder.r~ would be missed for example). This > should work better: > > has-backup-file?: func [ > {Returns true if any item in block ends with r~} > arg [block!] > ][ > forall arg [ > if (result: find/tail first arg "r~") [ > if (length? result) = 2 [ > return true > ] > ] > ] > return false > ] > > Later, > > Stephen >
You could also use the empty? function if you wanted has-backup-file?: func [ {Returns true if any item in block ends with r~} arg [block!] /local result ][ forall arg [ if all [ result: find/last/tail first arg "r~" empty? result ][ return true ] ] false ] Julian Kinraid