Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TZipWrite.AddDeflate() and MODERN 7FM.exe #115

Closed
vlad-mal opened this issue Aug 5, 2022 · 2 comments
Closed

TZipWrite.AddDeflate() and MODERN 7FM.exe #115

vlad-mal opened this issue Aug 5, 2022 · 2 comments

Comments

@vlad-mal
Copy link

vlad-mal commented Aug 5, 2022

Hello!
I found that .zip files created with a call to the AddDeflated() method:
procedure AddDeflated(const aFileName: TFileName;
RemovePath: boolean = true; CompressLevel: integer = 6;
ZipName:TFileName=''); overload;

  • are handled incorrectly by modern versions of the graphical utility 7zFM.exe (7zip file manager ) when the ZipName string-parameter contains "reverse" eg "Delphi2007\Trash\1zip64". In this case, all files appear as being in the same directory, with a long file name that includes the directory.
    For example, let's create a directory containing
  1. file named "File In Root Folder.txt"
  2. directory named "Child Folder"
  3. In the "Child Folder" directory, create a file named "File in Child Folder.txt".

Now let's zip this directory by sequentially calling the AddDeflate method for each file. The ZipName must contain a relative path with backslashes. Then we open the resulting archive (necessarily with a NEW version) with the 7zFM utility. We see that there is no file structure in the archive, there are only a couple of files with strange names:

1

If you change the backslashes to forward slashes, then everything will be fine:
2
...
Note: if you create a .zip file not one at a time, but all at once, by calling the AddFolder() method, then everything will be fine: in the implementation of the AddFolder() method, the AddDeflated() method is called, in which only forward slashes are present!
Regards, Malinovsky Vladimir.

@synopse
Copy link
Owner

synopse commented Aug 7, 2022

I am not to reproduce your problem.
Do you have some code to share to reproduce it?

TZipWrite.AddDeflated() calls ZipName := NormalizeZipName(aFileName) in line 1745 which should put the proper / separator everywhere in place to .

@synopse synopse closed this as completed in 98b2fd2 Aug 9, 2022
@synopse
Copy link
Owner

synopse commented Aug 9, 2022

I tried to make a paranoid fix for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants