Hello all,
In the following script, 'list-dirs is a function that returns the
directory tree under the directory specified as an argument.
On WinNT, using REBOL/Core 2.4.24.3.1, that script will throw an error
when it encounters a directory that has a dot in its name (for
example, "temp.old"). Furthermore, the error is thrown only if that
directory is a second level sub-directory of the argument (for example
"%/c/temp/temp1/temp.old" and not "%/c/temp/temp.old").
The most confusing thing is that if I remove the local definition of
'dirtree in the func spec, no error is thrown at all.
I do not understand what is happening.

REBOL []
dir: %/c/temp/
count: 0
list-dirs: func [
        "returns dir tree as block"
        dir [file!] "root dir"
        /local dirtree [block!]
        ] 
        [
  if count = 0 [dirtree: make block! 100]
  count: count + 1
  foreach name read dir [
        if dir? dir/:name [
                append dirtree dir/:name
                list-dirs dir/:name
      ]
  ]
        dirtree
]
print list-dirs dir
halt  

-- 
Fantam


Reply via email to