I tried to write some function similar to xcopy using the walk_dir() routine, but I needed to supply the "your_function" with an additional data such as destination directory, overwriting flag etc.
So I looked to the walk_dir() code and found that the routine already has such functionality:
public function walk_dir(sequence path_name, object your_function, integer scan_subdirs = types:FALSE,
object dir_source = types:NO_ROUTINE_ID)
-- snip
if sequence(your_function) then
user_data = append(user_data, your_function[2])
your_function = your_function[1]
end if
-- snip
abort_now = call_func(your_function, user_data)
-- snip
end function
It would be nice if this useful feature was documented.
changeset: 6004:770fab24d222 branch: 4.0 parent: 6002:806754addbe0 user: Matt Lewis date: Wed Feb 27 15:02:54 2013 -0500 files: docs/release/4.0.6.txt include/std/filesys.e description: