"; # $newzip = new dZip('dUnzip2.zip'); # // Create a folder in the ZIP, to store dZip and dUnzip files # echo "Creating folder to store both classes
"; # $newzip->addDir('class dZip'); # $newzip->addDir('class dUnzip2'); # // Put the files # echo "Adding files to the zip
"; # $newzip->addFile('dUnzip2.inc.php', 'class dUnzip2/dUnzip2.inc.php'); # $newzip->addFile('documentation.txt','class dUnzip2/documentation.txt'); # $newzip->addFile('dZip.inc.php', 'class dZip/dZip.inc.php'); # $newzip->addFile('sample.php', 'sample.php'); # // Save the new file # echo "Finalizing the created file
"; # $newzip->save(); ######## Then, load the file again. Now, to unzip it ######## echo "
"; $zip = new dUnzip2('dUnzip2.zip'); // Activate debug $zip->debug = true; // Unzip all the contents of the zipped file to a new folder called "uncompressed" $zip->getList(); $zip->unzipAll('uncompressed'); echo "Checking attributes for dUnzip2.gif
"; $d = $zip->getExtraInfo('dUnzip2.gif'); echo ($d['external_attributes1']&1 )?"File is read only.":"File is NOT read-only."; echo "
"; echo ($d['external_attributes1']&2 )?"File is hidden.":"File is NOT hidden."; echo "
"; echo ($d['external_attributes1']&4 )?"File is system.":"File is NOT system."; echo "
"; echo ($d['external_attributes1']&16)?"It's directory.":"It's NOT a directory."; echo "
"; echo ($d['external_attributes1']&32)?"File is archive":"File is NOT archive"; echo "
"; // No secrets, do you agree?