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

2000-09-08 Thread jkinraid
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!] > ][ >

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

2000-09-07 Thread joel . neely
One possible solution is: >> stuff: [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r %instinet.r~ [%lconfig.r %lconfig.r~ %nntp.r %notes.html %rebdoc.r %dummy.ftp [%dummy2.ftp~ %readby.ftp] == [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r %instinet.r~ %lconfig.r %lconfig.

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

2000-09-07 Thread ssayer
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 [

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

2000-09-07 Thread ssayer
This one and the one before won't work as asked because they'll return true for files with r~ anywhere in the name. Try this instead (off the top of my head): has-backup-file?: func [ {Returns true if any item in block ends with r~} arg [block!] ][ forall arg [

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

2000-09-07 Thread christmn
al Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 07, 2000 8:17 AM Subject: [REBOL] Second request for help: globbing on a block of filenames I have a block which contains filenames. I would like to get a true or false value back indica

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

2000-09-07 Thread johnkenyon
Hi, Or even - test-for-ext: func [ "Search a block for items ending with the given string. Returns TRUE or FALSE" value [string!] data [block!] ] [ foreach item data [ if find/last item value [ return true ] false ] ] cheers, john > I have a block which con

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

2000-09-07 Thread johnkenyon
Hi, Try - test-for-ext: func [ "Search a block for items ending with the given string. Returns TRUE or FALSE" value [string!] data [block!] ] [ foreach item data [ if find/reverse tail item value [ return true ] false ] ] cheers, john > I have a block which

[REBOL] Second request for help: globbing on a block of filenames

2000-09-07 Thread princepawn
I have a block which contains filenames. I would like to get a true or false value back indicating whether or not there is a filename in the block that terminates with a r~ extension. Please show me how to do this. >> a == [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r %instinet.r~ %lconfig.r