From 94a0f37aff90bba915bd2903c16b487bf0a4b201 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Fri, 26 Jul 2024 07:33:36 +0000 Subject: [PATCH] Skip sticky-bit check in `isDeletableFile` on WASI WASI does not surface the sticky bit and getuid, so we cannot check whether the file is actually deletable before attempting to delete it. --- .../FoundationEssentials/FileManager/FileManager+Files.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/FoundationEssentials/FileManager/FileManager+Files.swift b/Sources/FoundationEssentials/FileManager/FileManager+Files.swift index a6fbbecf3..11e05e073 100644 --- a/Sources/FoundationEssentials/FileManager/FileManager+Files.swift +++ b/Sources/FoundationEssentials/FileManager/FileManager+Files.swift @@ -461,7 +461,7 @@ extension _FileManagerImpl { parent = fileManager.currentDirectoryPath } -#if os(Windows) +#if os(Windows) || os(WASI) return fileManager.isWritableFile(atPath: parent) && fileManager.isWritableFile(atPath: path) #else guard fileManager.isWritableFile(atPath: parent),