D18562: Determine isDirectory by "Folder = " field in 7z plugin
Alexander Kernozhitsky
noreply at phabricator.kde.org
Sun Jan 27 08:53:59 GMT 2019
gepardo created this revision.
Herald added subscribers: Ark, kde-utils-devel.
Herald added a project: Ark.
gepardo requested review of this revision.
REVISION 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.
REPOSITORY
R36 Ark
BRANCH
fix-7z-folder (branched from master)
REVISION DETAIL
https://phabricator.kde.org/D18562
AFFECTED FILES
plugins/cli7zplugin/cliplugin.cpp
To: gepardo
Cc: kde-utils-devel, #ark, tctara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-utils-devel/attachments/20190127/c8dc52fc/attachment.html>
More information about the Kde-utils-devel
mailing list