Link to home
Start Free TrialLog in
Avatar of Tek Info
Tek Info

asked on

Updating a current 7 zip file

In the 7zip command line function use the "u" for Update function.
If the Zip file was never created will is simply update it with any data it finds at the source?
Also if the Zip file was infact created - will it simply update the current zip file with the new data and delete the old data?
Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@Tek Info

>> will it simply update the current zip file with the new data and delete the old data?

1)
hai.txt is there before creating first zip file
2)
created "sample.7z" file
3)
we have updated hai.txt => removed blank lines and last ten lines.
4)
recreating "sample.7z" file without taking a backup of original zip file
5)
new "sample.7z"  will have hai.txt having new contents without having old contents.
6)
Hence take a backup of old zip file before creating new zip file.
7)
validate the disk space
a. before copying backup files.
b. before creating zip file
Avatar of noci
noci

Any zip archive is strictly sequential. So all updates make a copy from the source (can be empty or non-existent) and NOT copy anything that needs to be deleted / replaced. Add new data for all new files and replaced files.  All results are written to a temp file. In the end (assuming no errors) the temp file is renamed to the zip file. (possibly erasing an old one).