SUMMARY Ark fails to parse 7z archive if it was created with attributes omitted ('-mtr=off'). STEPS TO REPRODUCE 1. Create a 7z archive, containing directories, with '-mtr=off' flag. 2. Open the archive in Ark. OBSERVED RESULT Ark fails to parse the archive properly. EXPECTED RESULT Ark should parse the archive properly. SOFTWARE/OS VERSIONS Ark 23.08.2 ADDITIONAL INFORMATION This is because Ark relies on 'D' attribute to detect directories inside 7z archives. https://invent.kde.org/utilities/ark/-/blob/8c7e0a2117fc6db538b3df33b19e9b910f07c160/plugins/cli7zplugin/cliplugin.cpp#L259 Usually archive records look like this: Path = test Size = 0 Packed Size = 0 Modified = 2023-10-28 12:52:18.4874650 Attributes = D drwxr-xr-x CRC = Encrypted = - Method = Block = But when '-mtr=off' flag is used during archive creation, all attribuites are omitted: Path = test Size = 0 Packed Size = 0 Modified = 2023-10-28 12:52:18.4874650 CRC = Encrypted = - Method = Block = So Ark fails to detect it as a directory.
The problem is, seems like there is no way to distinguish between directories and empty files via 7z CLI, without relying on attributes. Path = test Size = 0 Packed Size = 0 Modified = 2023-10-28 13:10:47.8804270 CRC = Encrypted = - Method = Block = Path = test/test Size = 0 Packed Size = 0 Modified = 2023-10-28 13:10:49.8933970 CRC = Encrypted = - Method = Block = The first record is a directory, the second is an empty file.
By the way, opening such archive in debug build causes Ark to crash with failed assertion. ASSERT: "isDir()" in file /ark/kerfuffle/archiveentry.cpp, line 90 [1] 18771 IOT instruction (core dumped) ark /test.7z
Created attachment 162616 [details] Test archive Test archive made with '-mtr=off', just in case.
I'll mark this one as fixed. As discussed on gitlab, the new libarchive-based 7z backend can handle these kind of archives just fine.