Back to... Zip-Ada

Source file : demo_zip.adb



   1  --  Zip archive creation demo.
   2  --  For a complete Zip creation tool, see tools/zipada.adb .
   3  --
   4  with Zip.Create;
   5  
   6  procedure Demo_Zip is
   7    use Zip.Create;
   8    zip_file : aliased Zip_File_Stream;  --  Archive is a file in this example.
   9    archive : Zip_Create_Info;
  10  begin
  11    Create_Archive (archive, zip_file'Unchecked_Access, "mini_zip.zip");
  12    --  We insert a couple of files into the Zip archive:
  13    Add_File (archive, "demo/demo_zip.adb", Password => "1234");
  14    Add_File (archive, "demo/demo_unzip.adb");
  15    --  Here we add directly some contents to the Zip archive
  16    --  without a file in the first place:
  17    Add_String
  18      (archive,
  19       "==== Hello world! ====" & ASCII.LF &
  20       "It is such a nice ""Hello world""-like demo, isn't it ?",
  21       "nice_string.txt");
  22    Add_Empty_Folder (archive, "empty_folder/");
  23    Finish (archive);
  24  end Demo_Zip;

Web view of Ada source code generated by GNATHTML, project: ALI_Parse version 1.0.
Zip-Ada: Ada library for zip archive files (.zip). Ada programming.
Some news about Zip-Ada and other Ada projects on Gautier's blog.