[REBOL] Second request for help: globbing on a block of filenames Re:
From: christmn:clackamas:ds:adp at: 7-Sep-2000 10:29
This is a multi-part message in MIME format.
------=_NextPart_000_0025_01C018B6.8A0BAF70
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
a: [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r %instinet.r~ %lconfig.r %lconfig.r~
%nntp.r %notes.html %rebdoc.r %rebol.exe]
foreach file a [if find/match/any file "*.r~" [print ["found one: " :file]]]
OR
a: [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r %instinet.r~ %lconfig.r %lconfig.r~
%nntp.r %notes.html %rebdoc.r %rebol.exe]
pattern: "*.r~"
foreach file a [if find/match/any file pattern [print ["found one: " :file]]]
OR for looking directly at the systems directories
files: read %.
pattern: "*.cgi"
foreach file files [if find/match/any file pattern [print ["found one: " :file]]]
found one: demo.cgi
found one: printenv.cgi
found one: webenv.cgi
found one: test.cgi
found one: man.cgi
found one: fetchurl.cgi
found one: hw2test.cgi
found one: wx.cgi
found one: reb_fetch.cgi
found one: fxhtml.cgi
----- Original Message -----
From: [princepawn--lycos--com]
To: [list--rebol--com]
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
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 %lconfig.r~
%nntp.r %notes.html %rebdoc.r
%rebol.exe %re...
Could someone show me how to glob for feedback.r?
In other words, I want to say
Get your FREE Email and Voicemail at Lycos Communications at
http://comm.lycos.com
------=_NextPart_000_0025_01C018B6.8A0BAF70
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>a: [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r
%instinet.r~ %lconfig.r %lconfig.r~ %nntp.r %notes.html %rebdoc.r
%rebol.exe]<BR>foreach file a [if find/match/any file "*.r~" [print ["found one:
:file]]]</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>OR</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>a: [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r
%instinet.r~ %lconfig.r %lconfig.r~ %nntp.r %notes.html %rebdoc.r
%rebol.exe]<BR>pattern:
*.r~"<BR>foreach file a [if find/match/any file pattern
[print ["found one: " :file]]]</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>OR for looking directly at the systems
directories</FONT></DIV>
<DIV><FONT size=2><BR><FONT size=2>
<P>files: read %.<BR><FONT size=2>pattern: "*.cgi"<BR>foreach file files [if
find/match/any file pattern [print ["found one: " :file]]]<BR></FONT><FONT
size=2><BR>found one: demo.cgi<BR>found one: printenv.cgi<BR>found one:
webenv.cgi<BR>found one: test.cgi<BR>found one: man.cgi<BR>found one:
fetchurl.cgi<BR>found one: hw2test.cgi<BR>found one: wx.cgi<BR>found one:
reb_fetch.cgi<BR>found one: fxhtml.cgi</P></FONT></FONT></DIV></FONT>
<DIV><FONT size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000
2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=[princepawn--lycos--com]
href="mailto:[princepawn--lycos--com]">[princepawn--lycos--com]</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=[list--rebol--com]
href="mailto:[list--rebol--com]">[list--rebol--com]</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, September 07, 2000 8:17
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [REBOL] Second request for help:
globbing on a block of filenames</DIV>
<DIV><BR></DIV>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.<BR><BR>Please show me how to do
this.<BR><BR>>> a<BR>== [%cast.r %feedback.r %ftp.r %ftp.r~ %instinet.r
%instinet.r~ %lconfig.r %lconfig.r~ %nntp.r %notes.html
%rebdoc.r<BR>%rebol.exe %re...<BR><BR>Could someone show me how to glob for
feedback.r?<BR><BR>In other words, I want to say<BR><BR><BR>Get your FREE
Email and Voicemail at Lycos Communications at<BR><A
href="http://comm.lycos.com">http://comm.lycos.com</A><BR><BR></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_0025_01C018B6.8A0BAF70--