Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
Zip
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
YongYue
Zip
Commits
acf81e74
Commit
acf81e74
authored
Feb 09, 2017
by
Mostafa Berg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Zip.swift now sets permissions to extracted files from fileInfo, fixes issue #72
parent
6f3b6b44
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
Zip/Zip.swift
Zip/Zip.swift
+11
-0
No files found.
Zip/Zip.swift
View file @
acf81e74
...
...
@@ -145,6 +145,7 @@ public class Zip {
unzGetCurrentFileInfo64
(
zip
,
&
fileInfo
,
fileName
,
UInt
(
fileNameSize
),
nil
,
0
,
nil
,
0
)
fileName
[
Int
(
fileInfo
.
size_filename
)]
=
0
var
pathString
=
String
(
cString
:
fileName
)
guard
pathString
.
characters
.
count
>
0
else
{
...
...
@@ -190,11 +191,21 @@ public class Zip {
break
}
}
fclose
(
filePointer
)
crc_ret
=
unzCloseCurrentFile
(
zip
)
if
crc_ret
==
UNZ_CRCERROR
{
throw
ZipError
.
unzipFail
}
//Set file permissions from current fileInfo
let
permissions
=
(
fileInfo
.
external_fa
>>
16
)
&
0x1FF
do
{
try
fileManager
.
setAttributes
([
.
posixPermissions
:
permissions
],
ofItemAtPath
:
fullPath
)
}
catch
let
error
{
print
(
"Failed to set permissions to file
\(
fullPath
)
"
)
}
ret
=
unzGoToNextFile
(
zip
)
// Update progress handler
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment