Mike ([EMAIL PROTECTED]) wrote:
> Hello all,

Hello Mike!

> I just noticed something strange happening. When i run the
> following code:
> 
> >> foreach file (read %/d/dir1/) [print [file modified? file]]
> File6.r none
> File4.r 6-Mar-2000/13:11:44-9:00
> File5.r 21-Apr-2000/11:06:28-8:00
> >>
> 
> It's listing the file names from d/dir/ but it's getting the 
> modified date from the file in the current directory (if it
> exists there), otherwise it returns none.
> 
> >> what-dir
> == %/D/Rebol/
> >>
> 
> Is this the expected behavior??? (It works the same way on 
> both /Core and /View)

Yes, this is the expected behavior. The result of read %/dir/
is a block containing the names of the files in that directory
as relative filenames. When you use modified? on relative names
directly, it treats them as relative to the current directory.

The way to fix that is to change them back to absolute names,
like this:
    foreach file (read %/d/dir1/) [
        file: join %/d/dir1/ file  ; This line does the trick
        print [file modified? file]
    ]

Does that help?

Brian

Reply via email to