Hi Alan,

<<
I am using the code below to read and sort the current directory contents.

It is _terribly_ slow on large directories (> 1000 files/directories)

either none? df: attempt [read %./][
    "Error reading Directory"
][
    foreach file df [insert tail either (dir? file)[dirs][files] file]
]
>>

DIR? does a bit of work to find out if a file has the directory flag set for
it (look at the source for it). Since REBOL is very consistent about how it
forms directory names, you can cheat a bit and avoid the extra disk hits for
every file by doing something like this:

either none? df: attempt [read %.][
    "Error reading Directory"
][
    foreach file df [
        insert tail either (#"/" = last file)[dirs][files] file
    ]
]

--Gregg

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to