Skip to content

Commit

Permalink
Again, fix Windows APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
fpseverino committed Sep 9, 2024
1 parent 0d12dc0 commit 5662231
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Sources/Zip/Zip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,8 @@ public class Zip {
// Windows does not have a direct equivalent for execute permissions
// You might need to handle this separately if required
}
// Convert fullPath to a wide string
let fullPathW = fullPath.withCString(encodedAs: UTF16.self) { $0 }
// Set the file attributes on Windows
let result = SetFileAttributesW(fullPathW, attributes)
if result == 0 {
if !SetFileAttributesW(fullPath.withCString(encodedAs: UTF16.self) { $0 }, attributes) {
print("Failed to set permissions to file \(fullPath), error: \(GetLastError())")
}
#else
Expand Down

0 comments on commit 5662231

Please sign in to comment.