Delphi function, Not allowing files and folders from main directory during compression
I used this code to combined all files into one from a directory, not really compression, procedure CompressDirectory(InDir : string; OutStream : TStream); var AE : TArchiveEntry; procedure RecurseDirectory(ADir : string); var sr : TSearchRec; TmpStream : TStream; begin if FindFirst(ADir + '*', faAnyFile, sr) = 0 then begin repeat if (sr.Attr and (faDirectory or faVolumeID)) = 0 then begin // We have a file (as opposed to a directory or anything // else). Write the file entry header. AE.EntryType := aeFile; AE.FileNameLen := Length(sr.Name); AE.FileLength := sr.Size; OutStream.Write(AE, SizeOf