Added a callback option to handle file pattern expansion.