erlang % Absolute paths provided - will accomodate most tasks
lists:foreach(fun (FileOrDirPath) -> Worker(FileOrDirPath) end, list_dir_path(Directory)).
-module(procfiles).
-export([start/0]).
start() ->
Directory = "c:/",
Worker = fun (File) -> io:format("~s~n", [File]) end,
% Absolute paths provided - will accomodate most tasks
lists:foreach(fun (FileOrDirPath) -> Worker(FileOrDirPath) end, list_dir_path(Directory)).
list_dir_path(Directory) ->
{ok, Files} = file:list_dir(Directory), lists:map(fun (File) -> filename:absname(File, Directory) end, Files).