-
I've encountered an issue with symbolic links not being created correctly when including files with symbolic links. My testing environment is as follows: Ubuntu 22.04 I also tried building 7za from 7zip 23.01 source for testing, and I encountered the same issue when creating files with symbolic links. To include symbolic links correctly, I had to use the "-snl" switch during creation: Even when attempting to use bit7z::BitAbstractArchiveCreator::setFormatProperty, it only raises an exception stating, "The parameter is incorrect." Decompression of a 7z file that includes symbolic links proceeds successfully. Is there a way to pass the 'snl' switch to the 7z library? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Hi! The good news is that I just pushed a commit to the release/v4.0.0 that implements it (929ab74)! I hope it works well! Thank you for pointing it out! |
Beta Was this translation helpful? Give feedback.
-
I attempted a test to compress a directory that includes symbolic links using the commit you provided. I encountered some issues, so I'm asking again.
This is the result of examining two files with BitArchiveReader.
I've discovered that during the compression process, when requesting the size of a file, it returns the size of the file that the symbolic link points to, rather than the size of the symbolic link itself (which is typically 8 bytes). I attempted to modify the 'size()' function in the FSItem class to use 'lstat64()' when dealing with symbolic links, but it seems that symbolic link handling is not fully implemented. In compressed files created using 7za, symbolic link files are not compressed; they are stored as 8 bytes, and the Block attribute is set to 0, not 1. Can you provide any assistance with this issue? |
Beta Was this translation helpful? Give feedback.
-
Yeah, 7-zip seems to handle symbolic links differently according to the archive format. I'm trying to find how the 7z format handles symbolic links, and I'll release a fix for this as soon as possible. |
Beta Was this translation helpful? Give feedback.
-
Hi! Let me know if it works for you! |
Beta Was this translation helpful? Give feedback.
Hi!
I just pushed a commit that should fix the handling of symbolic links in 7z archives (2de9981).
Now, bit7z doesn't follow symbolic links if you call
setStoreSymbolicLinks(true)
, which was the issue.As a side note, now enabling storing symbolic links also sets the solid compression mode to true, which is the same behavior of 7-zip/p7zip.
Let me know if it works for you!