Ryan,
If you read a directory it returns a block of names of it contents, as you
found,
you then have to read those files, to achieve what you wanted.
This example also checks to ensure that file is a file and not a directory,
Try
dir: %/boot/home/webdata/news/
foreach file read dir [
if not dir? dir/:file [ print read dir/:file]
]
Cheers,
Allen K
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, October 23, 1999 12:23 PM
Subject: [REBOL] read contents of each file in a dir
> OK, I'm stuck.
>
> I'm trying to read the contents of every file in a directory and use
> the contents of each file in a foreach statement.
>
> For example...
>
> foreach file load %/boot/home/webdata/news/ [print file]
>
> foreach file read %/boot/home/webdata/news/ [print file]
>
> Both of these statements simply print the name of the file.
>
> What do I need to do to harness the contents of the files instead of
> the file names themselves? It is not useful for me to list every file
> individually (i.e. as a block [ %file.txt %file2.txt ] )
>
> Thanks in advance for any help.
>
> Ryan Christiansen
>
>