bnobre 0 Posted May 18, 2023 Hello everybody, I'm using the class method below to extract the contents of zipped files: https://docwiki.embarcadero.com/Libraries/Alexandria/en/System.Zip.TZipFile.ExtractZipFile When extracting the zip file with this method, if there are files with the same name in the destination, will they be overwritten? For example: In the directory called test, the compact.zip file and a file called file1.txt are saved. The compact.zip file contains a file1.txt file. When extracting the file1.txt that is inside the compact.zip, will it overwrite the file file1.txt that is saved in the directory called test? Share this post Link to post
programmerdelphi2k 237 Posted May 18, 2023 (edited) @bnobre YES, it will be replaced! But you can choice "what" file need extract be do it, then, you can put in another folder, for example! Edited May 18, 2023 by programmerdelphi2k 1 Share this post Link to post
bnobre 0 Posted May 18, 2023 Hi @programmerdelphi2k, How are you? Thx for your answer. In fact I really want him to replace it, but since I didn't find anything in the Embarcadero documentation I was in doubt if it really overwrites or not. Share this post Link to post
programmerdelphi2k 237 Posted May 18, 2023 (edited) @bnobre try this... var MyZIP: TZipFile; begin MyZIP := TZipFile.Create; try MyZIP.ExtractZipFile('D:\MyZip\MyNewZip.zip', 'D:\MyZip'); finally MyZIP.Free; end; Edited May 18, 2023 by programmerdelphi2k Share this post Link to post
bnobre 0 Posted May 18, 2023 I tried, He overwrote. I was just in doubt because in the Embarcadero documentation nowhere does it say that it overrides. Thx Share this post Link to post