Diffusion Ark ca4667adf1cd

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

Authored by gepardo on Feb 10 2019, 8:50 PM.

Description

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

Details

Committed
elvisangelaccioFeb 10 2019, 8:50 PM
Reviewer
elvisangelaccio
Differential Revision
D18562: Determine isDirectory by "Folder = " field in 7z plugin
Parents
R36:6b72fca27326: Merge branch 'Applications/18.12'
Branches
Unknown
Tags
Unknown