Originally Posted By: Pax
...it tries to treat the files in $destdirs as directories
A look at my DIR() Primer FAQ would show how to differentiate files from folders using (GetFileAttr($basedir+"\"+$name) & 16).

http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81929#Post81929

That said, DIR() is old school and the UDFs are the way to go.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.