Author: Jonas Bilinkevicius Remember DOS? We can combine multiple ASCII files to one by using the copy command like: copy file1 + file2 + file3 file4 .That makes file4 to become the sum of file1, file2 and file3. Does the ShFileOperation API supports this feature or is there any other API support this? Answer: Solve 1: 1 2 procedure TForm1.Button1Click(Sender: TObject); 3 var 4 Stream1, Stream2: TFileStream; 5 begin 6 Stream1 := TFileStream.Create('c:\file4', fmCreate or fmShareExclusive); 7 try 8 { first file } 9 Stream2 := TFileStream.Create('c:\file1', fmOpenRead or fmShareDenyNone); 10 try 11 Stream1.CopyFrom(Stream2, Stream2.Size); 12 finally 13 Stream2.Free; 14 end; 15 { next file } 16 Stream2 := TFileStream.Create('c:\file2', fmOpenRead or fmShareDenyNone); 17 try 18 Stream1.CopyFrom(Stream2, Stream2.Size); 19 finally 20 Stream2.Free; 21 end; 22 { and so on } 23 finally 24 Stream1.Free; 25 end; 26 end; Solve 2: 27 28 function AppendFiles(Files: TStrings; const DestFile: string): integer; 29 var 30 srcFS, destFS: TFileStream; 31 i: integer; 32 F: string; 33 begin 34 result := 0; 35 if (Files.Count > 0) and (DestFile <> '') then 36 begin 37 destFS := TFileStream.Create(DestFile, fmCreate or fmShareExclusive); 38 try 39 i := 0; 40 while i < Files.Count do 41 begin 42 F := Files(i); 43 Inc(i); 44 if (CompareText(F, DestFile) <> 0) and (F <> '') then 45 begin 46 srcFS := TFileStream.Create(F, fmOpenRead or fmShareDenyWrite); 47 try 48 if destFS.CopyFrom(srcFS, 0) = srcFS.Size then 49 Inc(result); 50 finally 51 srcFS.Free; 52 end; 53 end 54 else 55 begin 56 { error } 57 end; 58 end; 59 finally 60 destFS.Free; 61 end; 62 end; 63 end;