The current TStartupCopy class works brilliantly. However, if I want to copy (replace) all files in a specific folder or sub-folder, I need to first retrieve a list of their names and pass as the first parameter into CopyDocuments() which does the same.
To save this step and make the use easier, if the AFilenames parameter is passed as an empty array, could it copy all files?
e.g.: (Not the most efficient implementation. Just an example)
for LSourceFileName in TDirectory.GetFiles(LSourcePath, '*.*', TSearchOption.soTopDirectoryOnly) do
begin
LIndex := IndexStr(TPath.GetFileName(LSourceFileName), AFileNames);
if (Length(FileNames) = 0) or (LIndex > -1) then
TFile.Copy(LSourceFileName, TPath.Combine(LDestPath, AFileNames[LIndex]), True);
end;
The current TStartupCopy class works brilliantly. However, if I want to copy (replace) all files in a specific folder or sub-folder, I need to first retrieve a list of their names and pass as the first parameter into CopyDocuments() which does the same.
To save this step and make the use easier, if the AFilenames parameter is passed as an empty array, could it copy all files?
e.g.: (Not the most efficient implementation. Just an example)