From 56622318a5fa29da670fd2bfb799f14453504610 Mon Sep 17 00:00:00 2001 From: Francesco Paolo Severino Date: Mon, 9 Sep 2024 20:32:45 +0200 Subject: [PATCH] Again, fix Windows APIs --- Sources/Zip/Zip.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Sources/Zip/Zip.swift b/Sources/Zip/Zip.swift index b334b157..d4efde41 100644 --- a/Sources/Zip/Zip.swift +++ b/Sources/Zip/Zip.swift @@ -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