tarmakercons.pas 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. (**
  2. Copyright (c) 2000-2006 by Stefan Heymann
  3. See the file COPYING.DESTRUCTOR, included in this distribution,
  4. for details about the copyright.
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. ===============================================================================================
  9. Name : TarMakerCons
  10. ===============================================================================================
  11. Project : "TarMakerCons" Demo Application for LibTar.pas
  12. ===============================================================================================
  13. Subject : Main Window
  14. ===============================================================================================
  15. Date Author Changes
  16. -----------------------------------------------------------------------------------------------
  17. 2001-06-19 HeySt Start
  18. 2006-10-20 MvdV Fork from GUI version to Console app for
  19. easier testing with FPC on various platforms
  20. *)
  21. Program TarMakerCons;
  22. {$ifdef FPC}
  23. {$mode Delphi}
  24. {$endif}
  25. {$apptype Console}
  26. Uses SysUtils,LibTar;
  27. var p : string;
  28. d : TSearchRec;
  29. TarWriter : TTarWriter;
  30. begin
  31. if paramcount<1 then
  32. begin
  33. Writeln('TarMakerCons, compresses *.pas files into a .tar');
  34. writeln('Usage : TarMakerCons <filename to create>');
  35. exit;
  36. end;
  37. TarWriter := TTarWriter.Create (paramstr(1));
  38. if FindFirst('*.pas',faAnyFile-faDirectory,d)=0 Then
  39. begin
  40. repeat
  41. TarWriter.AddFile (d.name);
  42. until findnext(d)<>0;
  43. Findclose(d);
  44. end;
  45. TarWriter.free;
  46. end.