[REBOL] Re: Understanding Data Types
From: jean:holzammer:faedv-n:bayern at: 8-Jun-2001 7:36
> I am a newbie to REBOL and trying to get a grip on it's data typing. My
> question concerns the following scenario:
>
> If I read a directory:
>
> foo: read %.
>
> how can I execute a find against the block? If I try:
>
> find foo "a.txt"
>
> I get a null response, as I do with most other variations. I know that
each
> entry in foo is considered a file type, and I am assuming that is why my
> find doesn't work, but what do I need to do to make it work?
Exactly. The entries in block foo are of type file!.
So try this:
find foo %a.txt
this results in a view to the block foo beginning from the position of
%a.txt in the block.
If you'd like to know , if block foo contains a file %a.txt, do this:
if found? find foo %a.txt
[
print "Entry exists in block"
]
If you just want to know, if file a.txt exists, you can use:
if exists? %a.txt
[
print "file exists"
]
Jean