Skip to content
Commit ca4667ad authored by Alexander Kernozhitsky's avatar Alexander Kernozhitsky Committed by Elvis Angelaccio
Browse files

Determine isDirectory by "Folder = " field in 7z plugin

Summary:
After looking at 7zip sources, I've found that there are two types of file attributes:

* FAT/Windows (e. g. "RA", "RDA")
* Unix (e. g. "_ -rwxr-xr-x" or "D_ drwxr-xr-x")

Earlier, isDirectory property was determined by "Attributes = " field. But this is incorrect, when 7z returns strings like

"Attributes = RDA"

This is a directory, but the code searched for "D" in the beginning and failed. Due to that, the archive couldn't be displayed properly.

I used a more canonical way to determine isDirectory: parsing "Folder = " field in 7z's output. Also reworked handling "Attributes = " field to handle both cases correctly.

Test Plan: Rebuilt ark and tried on some zip archives (also on the archive that ark was unable to display properly). Everything works OK.

Reviewers: elvisangelaccio

Reviewed By: elvisangelaccio

Subscribers: elvisangelaccio, kde-utils-devel, #ark

Tags: #ark

Differential Revision: https://phabricator.kde.org/D18562
parent 6b72fca2
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment