Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.
Swift cache-cleanercleanerclideveloper-toolsdisk-cleanupdisk-spaceduplicate-finderhomebrewliquid-glassmac-cleanermacosmacos-appmacos-golden-gatemacos-tahoemacos-tweaksswiftswiftuiterminal-themesuninstalluninstaller
Refuse to move anything that syncs to the cloud
Țugui Dragoșe0b68e67f19e
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstringsindex 2c210253..73aa01c9 100644--- a/Localization/Peel/Localizable.xcstrings+++ b/Localization/Peel/Localizable.xcstrings@@ -67725,6 +67725,112 @@}}},+ "Left alone: this syncs with iCloud or another cloud service, and moving it to the Trash would also remove it from the cloud and from your other devices." : {+ "localizations" : {+ "cs" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Nedotčeno: tato položka se synchronizuje s iCloudem nebo jinou cloudovou službou a přesunutím do koše byste ji odstranili také z cloudu i z vašich ostatních zařízení."+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Unangetastet: Dieses Objekt wird mit iCloud oder einem anderen Cloud-Dienst synchronisiert, und es in den Papierkorb zu legen, würde es auch aus der Cloud und von deinen anderen Geräten entfernen."+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "No se toca: se sincroniza con iCloud o con otro servicio en la nube, y trasladarlo a la papelera también lo eliminaría de la nube y de tus otros dispositivos."+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Laissé en place : cet élément est synchronisé avec iCloud ou avec un autre service de cloud, et le placer dans la corbeille le supprimerait aussi du cloud et de vos autres appareils."+ }+ },+ "it" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Resta dov’è: si sincronizza con iCloud o con un altro servizio cloud, e spostarlo nel Cestino lo rimuoverebbe anche dal cloud e dagli altri tuoi dispositivi."+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "対象外: これはiCloudまたはほかのクラウドサービスと同期されているため、ゴミ箱に入れると、クラウドからも、ほかのデバイスからも削除されます。"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "그대로 둠: 이 항목은 iCloud나 다른 클라우드 서비스와 동기화되며, 휴지통으로 이동하면 클라우드는 물론 다른 기기에서도 삭제됩니다."+ }+ },+ "nl" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Blijft staan: dit wordt gesynchroniseerd met iCloud of een andere cloudvoorziening, en als je het naar de prullenmand verplaatst, verdwijnt het ook uit de cloud en van je andere apparaten."+ }+ },+ "pl" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Nietknięte: jest synchronizowane z iCloud lub z inną usługą w chmurze, a po przeniesieniu do Kosza zostałoby usunięte także z chmury i z Twoich pozostałych urządzeń."+ }+ },+ "pt" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Preservado: este item é sincronizado com o iCloud ou com outro serviço de nuvem, e movê-lo para o Lixo também o removeria da nuvem e dos seus outros dispositivos."+ }+ },+ "ro" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Lăsat neatins: acest articol se sincronizează cu iCloud sau cu un alt serviciu cloud, iar mutarea lui în Coș l‑ar elimina și din cloud, și de pe celelalte dispozitive ale dvs."+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Остается на месте: этот объект синхронизируется с iCloud или другой облачной службой, и, если переместить его в Корзину, он будет удален также из облака и с других Ваших устройств."+ }+ },+ "sv" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Rörs inte: det här synkroniseras med iCloud eller en annan molntjänst, och om det flyttades till papperskorgen skulle det också tas bort från molnet och från dina andra enheter."+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Yerinde kalır: bu, iCloud veya başka bir bulut servisiyle eşzamanlanıyor ve Çöp Sepeti’ne taşınırsa buluttan ve diğer aygıtlarınızdan da silinir."+ }+ },+ "uk" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Лишається на місці: цей елемент синхронізується з iCloud або іншою хмарною службою, і переміщення в Смітник також прибрало б його з хмари й з інших ваших пристроїв."+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "留在原处:此项与iCloud或其他云服务同步,如果将它移到废纸篓,它也会从云端和你的其他设备中删除。"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "原地保留:此項目會與iCloud或其他雲端服務同步,丟到「垃圾桶」也會將它從雲端和你的其他裝置上移除。"+ }+ }+ }+ },"Left out: %@." : {"localizations" : {"cs" : {@@ -91001,112 +91107,6 @@}}},- "Not selected: this is in iCloud Drive, so moving it to the Trash removes it from iCloud and from your other devices." : {- "localizations" : {- "cs" : {- "stringUnit" : {- "state" : "translated",- "value" : "Nevybráno: tento soubor je na iCloud Drivu, takže přesunutím do koše ho odstraníte z iCloudu i z vašich ostatních zařízení."- }- },- "de" : {- "stringUnit" : {- "state" : "translated",- "value" : "Nicht ausgewählt: Dieses Objekt liegt in iCloud Drive, daher wird es aus iCloud und von deinen anderen Geräten entfernt, wenn du es in den Papierkorb legst."- }- },- "es" : {- "stringUnit" : {- "state" : "translated",- "value" : "Sin seleccionar: está en iCloud Drive, así que trasladarlo a la papelera lo elimina de iCloud y de tus otros dispositivos."- }- },- "fr" : {- "stringUnit" : {- "state" : "translated",- "value" : "Non sélectionné : ce fichier se trouve dans iCloud Drive ; le placer dans la corbeille le supprime donc d’iCloud et de vos autres appareils."- }- },- "it" : {- "stringUnit" : {- "state" : "translated",- "value" : "Non selezionato: questo file si trova su iCloud Drive, quindi, se lo sposti nel Cestino, viene rimosso da iCloud e dagli altri tuoi dispositivi."- }- },- "ja" : {- "stringUnit" : {- "state" : "translated",- "value" : "未選択: これはiCloud Driveにあるため、ゴミ箱に入れると、iCloudからも、ほかのデバイスからも削除されます。"- }- },- "ko" : {- "stringUnit" : {- "state" : "translated",- "value" : "선택되지 않음: 이 파일은 iCloud Drive에 있으므로 휴지통으로 이동하면 iCloud는 물론 다른 기기에서도 삭제됩니다."- }- },- "nl" : {- "stringUnit" : {- "state" : "translated",- "value" : "Niet geselecteerd: dit staat op iCloud Drive, dus als je het naar de prullenmand verplaatst, verdwijnt het uit iCloud en van je andere apparaten."- }- },- "pl" : {- "stringUnit" : {- "state" : "translated",- "value" : "Nie zaznaczono: ten plik jest na iCloud Drive, więc po przeniesieniu do Kosza zostanie usunięty z iCloud i z Twoich pozostałych urządzeń."- }- },- "pt" : {- "stringUnit" : {- "state" : "translated",- "value" : "Não selecionado: este item está no iCloud Drive, então, se você o mover para o Lixo, ele será removido do iCloud e dos seus outros dispositivos."- }- },- "ro" : {- "stringUnit" : {- "state" : "translated",- "value" : "Neselectat: acest fișier se află pe iCloud Drive, așa că mutarea lui în Coș îl elimină de pe iCloud și de pe celelalte dispozitive ale dvs."- }- },- "ru" : {- "stringUnit" : {- "state" : "translated",- "value" : "Не выбрано: этот файл находится в iCloud Drive, поэтому, если переместить его в Корзину, он будет удален из iCloud и с других Ваших устройств."- }- },- "sv" : {- "stringUnit" : {- "state" : "translated",- "value" : "Inte markerad: den här filen ligger i iCloud Drive, så om du flyttar den till papperskorgen tas den bort från iCloud och från dina andra enheter."- }- },- "tr" : {- "stringUnit" : {- "state" : "translated",- "value" : "Seçilmedi: bu dosya, iCloud Drive’da olduğu için Çöp Sepeti’ne taşınırsa iCloud’dan ve diğer aygıtlarınızdan silinir."- }- },- "uk" : {- "stringUnit" : {- "state" : "translated",- "value" : "Не вибрано: цей файл зберігається в iCloud Drive, тож переміщення в Смітник прибирає його з iCloud і з інших ваших пристроїв."- }- },- "zh-Hans" : {- "stringUnit" : {- "state" : "translated",- "value" : "未选择:此文件位于iCloud云盘中,因此将它移到废纸篓后,它会从iCloud和你的其他设备中删除。"- }- },- "zh-Hant" : {- "stringUnit" : {- "state" : "translated",- "value" : "未選取:此項目位於「iCloud雲碟」中,因此丟到「垃圾桶」會將它從iCloud和你的其他裝置上移除。"- }- }- }- },"Not selected: this isn’t in Downloads and isn’t an installed app’s installer, so it may be yours rather than something you can download again." : {"localizations" : {"cs" : {@@ -113019,6 +113019,112 @@}}},+ "Peel won’t move this: it syncs with iCloud or another cloud service, and moving it to the Trash would also remove it from the cloud and from your other devices." : {+ "localizations" : {+ "cs" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel tuto položku nepřesune: synchronizuje se s iCloudem nebo jinou cloudovou službou a přesunutím do koše byste ji odstranili také z cloudu i z vašich ostatních zařízení."+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel verschiebt dies nicht: Es wird mit iCloud oder einem anderen Cloud-Dienst synchronisiert, und es in den Papierkorb zu legen, würde es auch aus der Cloud und von deinen anderen Geräten entfernen."+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel no trasladará esto: se sincroniza con iCloud o con otro servicio en la nube, y trasladarlo a la papelera también lo eliminaría de la nube y de tus otros dispositivos."+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel refuse de déplacer cet élément : il est synchronisé avec iCloud ou avec un autre service de cloud, et le placer dans la corbeille le supprimerait aussi du cloud et de vos autres appareils."+ }+ },+ "it" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel non lo sposta: si sincronizza con iCloud o con un altro servizio cloud, e spostarlo nel Cestino lo rimuoverebbe anche dal cloud e dagli altri tuoi dispositivi."+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peelはこれを移動しません。iCloudまたはほかのクラウドサービスと同期されているため、ゴミ箱に入れると、クラウドからも、ほかのデバイスからも削除されます。"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel이 이 항목을 이동하지 않습니다. iCloud나 다른 클라우드 서비스와 동기화되며, 휴지통으로 이동하면 클라우드는 물론 다른 기기에서도 삭제되기 때문입니다."+ }+ },+ "nl" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel verplaatst dit niet: het wordt gesynchroniseerd met iCloud of een andere cloudvoorziening, en als je het naar de prullenmand verplaatst, verdwijnt het ook uit de cloud en van je andere apparaten."+ }+ },+ "pl" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel tego nie przeniesie: jest synchronizowane z iCloud lub z inną usługą w chmurze, a po przeniesieniu do Kosza zostałoby usunięte także z chmury i z Twoich pozostałych urządzeń."+ }+ },+ "pt" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "O Peel não vai mover isto: é sincronizado com o iCloud ou com outro serviço de nuvem, e movê-lo para o Lixo também o removeria da nuvem e dos seus outros dispositivos."+ }+ },+ "ro" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel nu mută acest articol: se sincronizează cu iCloud sau cu un alt serviciu cloud, iar mutarea lui în Coș l‑ar elimina și din cloud, și de pe celelalte dispozitive ale dvs."+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel не будет это перемещать: объект синхронизируется с iCloud или другой облачной службой, и, если переместить его в Корзину, он будет удален также из облака и с других Ваших устройств."+ }+ },+ "sv" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel flyttar inte det här: det synkroniseras med iCloud eller en annan molntjänst, och om det flyttades till papperskorgen skulle det också tas bort från molnet och från dina andra enheter."+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel bunu taşımaz: iCloud veya başka bir bulut servisiyle eşzamanlanıyor ve Çöp Sepeti’ne taşınırsa buluttan ve diğer aygıtlarınızdan da silinir."+ }+ },+ "uk" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel не перемістить це: елемент синхронізується з iCloud або іншою хмарною службою, і переміщення в Смітник також прибрало б його з хмари й з інших ваших пристроїв."+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel不会移动此项:它与iCloud或其他云服务同步,如果将它移到废纸篓,它也会从云端和你的其他设备中删除。"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel不會移動此項目:它會與iCloud或其他雲端服務同步,丟到「垃圾桶」也會將它從雲端和你的其他裝置上移除。"+ }+ }+ }+ },"Peel won’t move this: something Peel protects is inside, such as a keychain or a wallet." : {"localizations" : {"cs" : {@@ -162677,112 +162783,6 @@}}},- "This file is in iCloud Drive, so moving it to the Trash removes it from iCloud and from your other devices." : {- "localizations" : {- "cs" : {- "stringUnit" : {- "state" : "translated",- "value" : "Tento soubor je na iCloud Drivu, takže přesunutím do koše ho odstraníte z iCloudu i z vašich ostatních zařízení."- }- },- "de" : {- "stringUnit" : {- "state" : "translated",- "value" : "Diese Datei liegt in iCloud Drive, daher wird sie aus iCloud und von deinen anderen Geräten entfernt, wenn du sie in den Papierkorb legst."- }- },- "es" : {- "stringUnit" : {- "state" : "translated",- "value" : "Este archivo está en iCloud Drive, así que trasladarlo a la papelera lo elimina de iCloud y de tus otros dispositivos."- }- },- "fr" : {- "stringUnit" : {- "state" : "translated",- "value" : "Ce fichier se trouve dans iCloud Drive : le placer dans la corbeille le supprime donc d’iCloud et de vos autres appareils."- }- },- "it" : {- "stringUnit" : {- "state" : "translated",- "value" : "Questo file si trova su iCloud Drive, quindi, se lo sposti nel Cestino, viene rimosso da iCloud e dagli altri tuoi dispositivi."- }- },- "ja" : {- "stringUnit" : {- "state" : "translated",- "value" : "このファイルはiCloud Driveにあるため、ゴミ箱に入れると、iCloudからも、ほかのデバイスからも削除されます。"- }- },- "ko" : {- "stringUnit" : {- "state" : "translated",- "value" : "이 파일은 iCloud Drive에 있으므로 휴지통으로 이동하면 iCloud는 물론 다른 기기에서도 삭제됩니다."- }- },- "nl" : {- "stringUnit" : {- "state" : "translated",- "value" : "Dit bestand staat op iCloud Drive, dus als je het naar de prullenmand verplaatst, verdwijnt het uit iCloud en van je andere apparaten."- }- },- "pl" : {- "stringUnit" : {- "state" : "translated",- "value" : "Ten plik jest na iCloud Drive, więc po przeniesieniu do Kosza zostanie usunięty z iCloud i z Twoich pozostałych urządzeń."- }- },- "pt" : {- "stringUnit" : {- "state" : "translated",- "value" : "Este arquivo está no iCloud Drive, então, se você o mover para o Lixo, ele será removido do iCloud e dos seus outros dispositivos."- }- },- "ro" : {- "stringUnit" : {- "state" : "translated",- "value" : "Acest fișier se află pe iCloud Drive, așa că mutarea lui în Coș îl elimină de pe iCloud și de pe celelalte dispozitive ale dvs."- }- },- "ru" : {- "stringUnit" : {- "state" : "translated",- "value" : "Этот файл находится в iCloud Drive, поэтому, если переместить его в Корзину, он будет удален из iCloud и с других Ваших устройств."- }- },- "sv" : {- "stringUnit" : {- "state" : "translated",- "value" : "Den här filen ligger i iCloud Drive, så om du flyttar den till papperskorgen tas den bort från iCloud och från dina andra enheter."- }- },- "tr" : {- "stringUnit" : {- "state" : "translated",- "value" : "Bu dosya, iCloud Drive’da olduğu için Çöp Sepeti’ne taşınırsa iCloud’dan ve diğer aygıtlarınızdan silinir."- }- },- "uk" : {- "stringUnit" : {- "state" : "translated",- "value" : "Цей файл зберігається в iCloud Drive, тож переміщення в Смітник прибирає його з iCloud і з інших ваших пристроїв."- }- },- "zh-Hans" : {- "stringUnit" : {- "state" : "translated",- "value" : "此文件位于iCloud云盘中,因此将它移到废纸篓后,它会从iCloud和你的其他设备中删除。"- }- },- "zh-Hant" : {- "stringUnit" : {- "state" : "translated",- "value" : "此檔案位於「iCloud雲碟」中,因此丟到「垃圾桶」會將它從iCloud和你的其他裝置上移除。"- }- }- }- },"This frees %@. Nothing is deleted from iCloud: the files stay there, Finder still lists them, and they download again when you open them." : {"localizations" : {"cs" : {diff --git a/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift b/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swiftindex 82d4a4ff..ce79ee4e 100644--- a/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift+++ b/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift@@ -301,6 +301,7 @@ extension GuardRefusal {case .staysItself: "a folder that stays in place, though what is inside may go"case .protectedLocation: "part of macOS, or inside something Peel protects"case .holdsProtectedData: "holds something Peel protects, such as a keychain or a wallet"+ case .inTheCloud: "syncs with iCloud or another cloud service, so moving it would remove it from every device"case .holdsDocuments: "holds an app's documents"case .holdsALibrary: "holds a photo, music, or video library"case .holdsWorkKeptInACache: "holds work an app keeps nowhere else, such as an editor's local history"@@ -344,7 +345,7 @@ extension HoldBack {case .keptByMacOS: "a cache macOS keeps for itself"case .openedFromMail: "an attachment opened from Mail, which may be the only copy"case .crashReport: "a crash report, which the app's developer may still ask for"- case .inTheCloud: "in iCloud Drive, so moving it removes it from every device"+ case .inTheCloud: "syncs with iCloud or another cloud service, so moving it would remove it from every device"case .openInAProgram: "open in a program right now, which may still be downloading it"case .changedRecently: "changed in the last day, so it may still be downloading"case .writtenRecently: "written to in the last 15 minutes, so a program may still be using it"diff --git a/Packages/PeelCore/Sources/PeelCore/Duplicates/DuplicateFinder.swift b/Packages/PeelCore/Sources/PeelCore/Duplicates/DuplicateFinder.swiftindex 83599b97..a3985850 100644--- a/Packages/PeelCore/Sources/PeelCore/Duplicates/DuplicateFinder.swift+++ b/Packages/PeelCore/Sources/PeelCore/Duplicates/DuplicateFinder.swift@@ -131,9 +131,7 @@ public struct DuplicateFinder: Sendable {}}guard !Task.isCancelled else { throw CancellationError() }- let sampledGroups = try Self.movable(Self.grouped(sampled), names: names) {- removalGuard.allowsRemoval(of: $0) && !$0.isInTheCloud- }+ let sampledGroups = try Self.movable(Self.grouped(sampled), names: names, isMovable: removalGuard.allowsRemoval)let finalGroups = sampledGroups.filter { !FileDigest.isSampled(size: $0[0].item.identity.size) }let toVerify = sampledGroups.filter { FileDigest.isSampled(size: $0[0].item.identity.size) }@@ -251,9 +249,8 @@ public struct DuplicateFinder: Sendable {}/// The groups as they may move: each file under the first of its `names`, in the order the walk found them,- /// that `isMovable` allows, and a group only while two files are left. `isMovable`, the guard and the cloud- /// check, which open the file and the folders above it, is asked only here, of files whose first and last- /// bytes already match another's.+ /// that `isMovable` allows, and a group only while two files are left. `isMovable`, the guard, which opens the+ /// file and the folders above it, is asked only here, of files whose first and last bytes already match another's.static func movable(_ groups: [[HashedCandidate]],names: [FileIdentity.Link: [Candidate]],diff --git a/Packages/PeelCore/Sources/PeelCore/Leftovers/Leftover.swift b/Packages/PeelCore/Sources/PeelCore/Leftovers/Leftover.swiftindex 32c2c02b..e25ef1fa 100644--- a/Packages/PeelCore/Sources/PeelCore/Leftovers/Leftover.swift+++ b/Packages/PeelCore/Sources/PeelCore/Leftovers/Leftover.swift@@ -110,7 +110,7 @@ public enum HoldBack: String, Sendable, Hashable {case openedFromMail/// A report macOS wrote when the app crashed, which its developer may still ask for.case crashReport- /// A file in iCloud Drive, which moving to the Trash removes from every device.+ /// It syncs to the cloud, and `RemovalGuard` refuses to move it: the Trash would remove it from every device.case inTheCloud/// A file a program has open right now, which may still be downloading it.case openInAProgram@@ -133,6 +133,7 @@ public enum HoldBack: String, Sendable, Hashable {self == .holdsDocuments || self == .holdsALibrary || self == .holdsKeys || self == .holdsWorkKeptInACache|| self == .beyondTheHelper || self == .leftToItsUninstaller|| self == .systemExtension || self == .systemExtensionGoingAtRestart || self == .holdsAnExclusion+ || self == .inTheCloud}/// Why what a walk saw leaves a folder to be chosen by hand: a wallet, a signing key, or a repository inside maydiff --git a/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swift b/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swiftindex 0e878cd9..31afbae4 100644--- a/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swift+++ b/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swift@@ -334,7 +334,8 @@ public struct LeftoverScanner: Sendable {parent: ParentAccess,home: String,foldersAbove: FoldersAbove = .itsOwn,- measure: Measure = LeftoverScanner.walk+ measure: Measure = LeftoverScanner.walk,+ isInTheCloud: (URL) -> Bool = { $0.isInTheCloud }) async -> Leftover {// The walk that measures the folder also reports whether it saw a repository or a wallet, so neither// check costs extra reading. A repository means the folder holds more than the app's state, such as work@@ -354,6 +355,8 @@ public struct LeftoverScanner: Sendable {.holdsALibrary} else if ProtectedData.holdsWorkKeptInACache(url.path(percentEncoded: false)) {.holdsWorkKeptInACache+ } else if isInTheCloud(url) {+ .inTheCloud} else if let keptOnlyHere = KeptOnlyHere.reason(for: url.path(percentEncoded: false), home: home) {keptOnlyHere} else if contents?.couldNotBeRead == true {diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/RemovalGuard.swift b/Packages/PeelCore/Sources/PeelCore/Removal/RemovalGuard.swiftindex e95eb520..3f83a1fe 100644--- a/Packages/PeelCore/Sources/PeelCore/Removal/RemovalGuard.swift+++ b/Packages/PeelCore/Sources/PeelCore/Removal/RemovalGuard.swift@@ -14,6 +14,8 @@ public enum GuardRefusal: String, Sendable, Hashable, CaseIterable {case protectedLocation/// Something Peel protects is inside, such as a keychain, a wallet's keys, or a browser profile with a wallet.case holdsProtectedData+ /// It syncs to the cloud (`isUbiquitousItem`), as Desktop and Documents do in iCloud Drive.+ case inTheCloud/// A sandboxed app's documents are inside.case holdsDocuments/// A photo, music, or video library is inside.@@ -29,6 +31,7 @@ public enum GuardRefusal: String, Sendable, Hashable, CaseIterable {case .staysItself: "stays-in-place"case .protectedLocation: "protected-place"case .holdsProtectedData: "holds-protected-data"+ case .inTheCloud: "in-the-cloud"case .holdsDocuments: "holds-documents"case .holdsALibrary: "holds-a-library"case .holdsWorkKeptInACache: "holds-work-kept-in-a-cache"@@ -56,12 +59,18 @@ struct RemovalGuard: Sendable {private let protectedTrees: [[String]]private let protectedObjects: ProtectedObjectsprivate let exclusions: Exclusions+ private let isInTheCloud: @Sendable (URL) -> Boolvar knowsTheExclusions: Bool { exclusions.isKnown }private let home: String- init(environment: SearchEnvironment, exclusions: Exclusions = .none) {+ init(+ environment: SearchEnvironment,+ exclusions: Exclusions = .none,+ isInTheCloud: @escaping @Sendable (URL) -> Bool = { $0.isInTheCloud }+ ) {self.exclusions = exclusions+ self.isInTheCloud = isInTheCloudlet home = environment.homeDirectoryself.home = home.path(percentEncoded: false)var paths: [String] = [@@ -178,6 +187,8 @@ struct RemovalGuard: Sendable {var info = stat()let protectedFlags = UInt32(SF_RESTRICTED) | UInt32(SF_NOUNLINK)guard lstat(path, &info) != 0 || info.st_flags & protectedFlags == 0 else { return .protectedLocation }+ // Moving what syncs to the cloud would remove it there and from every other device. Put Back removes nothing.+ if item == nil, names.contains(where: { isInTheCloud(URL(filePath: $0)) }) { return .inTheCloud }// Last, since each reads what is a level or two inside the folder, and a name refused above needs none of it.for name in names {diff --git a/Packages/PeelCore/Sources/PeelCore/Search/FileSearch.swift b/Packages/PeelCore/Sources/PeelCore/Search/FileSearch.swiftindex a3274288..30c970dc 100644--- a/Packages/PeelCore/Sources/PeelCore/Search/FileSearch.swift+++ b/Packages/PeelCore/Sources/PeelCore/Search/FileSearch.swift@@ -38,9 +38,6 @@ public struct FoundFile: Sendable, Hashable, Identifiable {/// True when the file sits in a Library folder, so it is an app's working data rather than something the user/// made. Such a file is listed last and never selected for the user.public var belongsToAnApp = false- /// True when the file is in iCloud Drive, as Desktop and Documents are when they sync: moving it to the Trash- /// removes it from every device. It is never selected for the user.- public var isInTheCloud = false/// The file's identity when it was listed. Results can stay on screen for a long time, and a file written/// again under the same name is not the one the row describes.public var identity: FileIdentity?@@ -114,8 +111,7 @@ public enum FileSearch {from paths: [String],environment: SearchEnvironment = .current,exclusions: Exclusions = .none,- allows: ((URL) -> Bool)? = nil,- isInTheCloud: (URL) -> Bool = { $0.isInTheCloud }+ allows: ((URL) -> Bool)? = nil) -> FileSearchResults {let allows = allows ?? RemovalGuard(environment: environment, exclusions: exclusions).allowsRemoval(of:)let appData = AppDataFolders(home: environment.homeDirectory)@@ -148,7 +144,6 @@ public enum FileSearch {modificationDate: Date(timeIntervalSince1970: TimeInterval(candidate.info.st_mtimespec.tv_sec)),requiresPrivileges: FileAccess.requiresPrivilegesToRemove(url),belongsToAnApp: candidate.belongsToAnApp,- isInTheCloud: isInTheCloud(url),identity: FileIdentity(candidate.info)))}diff --git a/Packages/PeelCore/Tests/PeelCoreTests/AttackRemovalGuardTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/AttackRemovalGuardTests.swiftindex b7aa4843..f3b5367d 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/AttackRemovalGuardTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/AttackRemovalGuardTests.swift@@ -606,6 +606,29 @@ struct AttackRemovalGuardTests {}}+ /// What syncs to the cloud stays wherever it is, as Desktop and Documents do in iCloud Drive: the Trash would+ /// take it from the cloud and from every other device. Put Back still brings an item there.+ @Test func whatSyncsToTheCloudStaysWhereverItIs() throws {+ let directory = try TemporaryDirectory()+ let home = directory.url.appending(path: "home", directoryHint: .isDirectory)+ let file = try directory.file("home/Desktop/Report.pdf")+ let folder = try directory.directory("home/Documents/Trip")+ let local = try directory.file("home/Desktop/Setup.dmg")+ let trashed = try directory.file("home/.Trash/Notes.txt")+ let synced: Set = ["Report.pdf", "Trip", "Notes.txt"]+ let guardian = RemovalGuard(+ environment: SearchEnvironment(homeDirectory: home, rootDirectory: directory.url.appending(path: "root")),+ isInTheCloud: { synced.contains($0.lastPathComponent) }+ )+ let (device, number) = try #require(inode(file.path(percentEncoded: false)))++ #expect(guardian.refusal(of: file) == .inTheCloud)+ #expect(guardian.refusal(of: folder) == .inTheCloud)+ #expect(guardian.refusal(of: URL(filePath: "/.vol/\(device)/\(number)")) == .inTheCloud, "asked by its numbers")+ #expect(guardian.refusal(of: local) == nil)+ #expect(guardian.allowsPuttingBack(trashed, at: home.appending(path: "Desktop/Notes.txt")))+ }+/// The guard refuses what is inside a container's `Data/Documents`, where a sandboxed app keeps what its/// user made. An uninstall lists the container around it, so the container is refused too while that folder/// holds anything or cannot be read.diff --git a/Packages/PeelCore/Tests/PeelCoreTests/FileSearchTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/FileSearchTests.swiftindex 88ea7e5c..637a3ace 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/FileSearchTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/FileSearchTests.swift@@ -123,22 +123,23 @@ struct FileSearchTests {#expect(!results.isTruncated)}- /// A file in iCloud Drive, as Desktop and Documents are when they sync, is listed with that said: moving it to- /// the Trash removes it from every device. A temporary folder holds no iCloud item, so which file is one is- /// given here, as macOS would answer.- @Test func saysWhichFilesAreInTheCloud() throws {+ /// A file that syncs to the cloud, as Desktop and Documents do in iCloud Drive, is never listed, since the guard+ /// refuses it. A temporary folder holds no such file, so which one syncs is given here, as macOS would answer.+ @Test func neverListsAFileThatSyncsToTheCloud() throws {let directory = try TemporaryDirectory()let home = directory.url.appending(path: "home", directoryHint: .isDirectory)let synced = try directory.file("home/Documents/Report.pdf", bytes: 9_000)let local = try directory.file("home/Downloads/Setup.dmg", bytes: 1_000)+ let environment = SearchEnvironment(homeDirectory: home, rootDirectory: directory.url)+ let guardian = RemovalGuard(environment: environment, isInTheCloud: { $0.lastPathComponent == "Report.pdf" })let results = FileSearch.results(from: [synced, local].map { $0.path(percentEncoded: false) },- environment: SearchEnvironment(homeDirectory: home, rootDirectory: directory.url),- isInTheCloud: { $0.lastPathComponent == "Report.pdf" }+ environment: environment,+ allows: guardian.allowsRemoval(of:))- #expect(results.files.map { "\($0.url.lastPathComponent): \($0.isInTheCloud)" } == ["Report.pdf: true", "Setup.dmg: false"])+ #expect(results.files.map(\.url.lastPathComponent) == ["Setup.dmg"])}/// A file whose contents live only in the cloud (`SF_DATALESS`) takes no room on this Mac, so moving it freesdiff --git a/Packages/PeelCore/Tests/PeelCoreTests/InstallersTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/InstallersTests.swiftindex ab72587d..7ce082a5 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/InstallersTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/InstallersTests.swift@@ -285,7 +285,8 @@ struct InstallersTests {#expect(scan.items.map(\.name) == ["Other-2.dmg"])}- @Test func anInstallerInICloudDriveIsLeftForThePersonToChoose() async throws {+ /// What syncs to the cloud is listed and cannot be selected: the guard refuses to move it.+ @Test func anInstallerThatSyncsToTheCloudCannotBeSelected() async throws {let directory = try TemporaryDirectory()try directory.file("Documents/Tool-2.dmg", bytes: 400_000)try directory.directory("Documents/Install macOS Tahoe.app/Contents")@@ -303,6 +304,8 @@ struct InstallersTests {#expect(heldBack["Tool-2.dmg"] == .inTheCloud)#expect(heldBack["Install macOS Tahoe"] == .inTheCloud)#expect(heldBack["Other-3.dmg"] == .some(nil))+ let selectable = scan.items.selectableRows(canUseHelper: true).selectable+ #expect(Set(scan.items.filter { selectable.contains($0.url) }.map(\.name)) == ["Other-3.dmg"])}/// An item only an administrator can move goes through the helper, which takes a macOS installer fromdiff --git a/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swiftindex ddb1f737..d822969a 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift@@ -1095,6 +1095,28 @@ struct LeftoverScannerTests {#expect(await leftover(photos, .applicationSupport).match.heldBack == .holdsALibrary)}+ /// What syncs to the cloud, as a cask's folder in Documents does in iCloud Drive, cannot be selected, since the+ /// guard refuses it. A temporary folder holds no such folder, so which one syncs is given here.+ @Test func aLeftoverThatSyncsToTheCloudCannotBeSelected() async throws {+ let directory = try TemporaryDirectory()+ let synced = try directory.directory("home/Documents/Example")+ let local = try directory.directory("home/Documents/Other")+ func leftover(_ url: URL) async -> Leftover {+ await LeftoverScanner.leftover(+ at: url,+ kind: .elsewhere,+ match: LeftoverMatch(reason: .bundleIdentifier, confidence: .certain, sharedWith: []),+ parent: ParentAccess(url.deletingLastPathComponent()),+ home: directory.url.appending(path: "home").path(percentEncoded: false),+ isInTheCloud: { $0.lastPathComponent == "Example" }+ )+ }++ #expect(await leftover(synced).match.heldBack == .inTheCloud)+ #expect(await leftover(synced).match.heldBack?.cannotBeMoved == true)+ #expect(await leftover(local).match.heldBack == nil)+ }+/// A browser's folder that holds a profile with a wallet extension cannot be selected either.@Test func aBrowsersFolderHoldingAWalletCannotBeSelected() async throws {let directory = try TemporaryDirectory()diff --git a/Peel/Model/FileSearchLibrary.swift b/Peel/Model/FileSearchLibrary.swiftindex 7f998367..96fe6ca2 100644--- a/Peel/Model/FileSearchLibrary.swift+++ b/Peel/Model/FileSearchLibrary.swift@@ -51,9 +51,7 @@ final class FileSearchLibrary {}results = foundfilteredBy = exclusions- recommendedURLs = Set(- found.files.filter { !$0.requiresPrivileges && !$0.belongsToAnApp && !$0.isInTheCloud }.map(\.url)- )+ recommendedURLs = Set(found.files.filter { !$0.requiresPrivileges && !$0.belongsToAnApp }.map(\.url))sizes = Dictionary(found.files.map { ($0.url, $0.size) }, uniquingKeysWith: { first, _ in first })selectedURLs.formIntersection(found.files.filter { !$0.requiresPrivileges }.map(\.url))// The search ran under the exclusions as they were when it started, so leave out anything excluded since.diff --git a/Peel/Views/FileSearch/FileSearchFileView.swift b/Peel/Views/FileSearch/FileSearchFileView.swiftindex da261420..57c10e48 100644--- a/Peel/Views/FileSearch/FileSearchFileView.swift+++ b/Peel/Views/FileSearch/FileSearchFileView.swift@@ -39,11 +39,6 @@ struct FileSearchFileView: View {.font(.callout).foregroundStyle(.secondary)}- if file.isInTheCloud {- Text("This file is in iCloud Drive, so moving it to the Trash removes it from iCloud and from your other devices.")- .font(.callout)- .foregroundStyle(.secondary)- }if file.belongsToAnApp {Text("An app keeps this in its Library folder, and may be using it right now.").font(.callout)diff --git a/Peel/Views/FileSearch/FileSearchList.swift b/Peel/Views/FileSearch/FileSearchList.swiftindex 237b8c9a..d3eb5f85 100644--- a/Peel/Views/FileSearch/FileSearchList.swift+++ b/Peel/Views/FileSearch/FileSearchList.swift@@ -125,9 +125,7 @@ struct FileSearchList: View {file.requiresPrivileges? String(localized: "File Search moves only what your account can move. Use Finder for this one."): nil,- file.isInTheCloud- ? String(localized: "This file is in iCloud Drive, so moving it to the Trash removes it from iCloud and from your other devices.")- : file.belongsToAnApp+ file.belongsToAnApp? String(localized: "An app keeps this in its Library folder, and may be using it right now."): nil,].compactMap(\.self)diff --git a/Peel/Views/Presentation.swift b/Peel/Views/Presentation.swiftindex 49fd3ce5..b8bc0057 100644--- a/Peel/Views/Presentation.swift+++ b/Peel/Views/Presentation.swift@@ -147,6 +147,7 @@ extension GuardRefusal {case .staysItself: "Peel won’t move this folder itself, since macOS expects to find it. What is inside it can go."case .protectedLocation: "Peel won’t move this: it is part of macOS, or inside something Peel protects."case .holdsProtectedData: "Peel won’t move this: something Peel protects is inside, such as a keychain or a wallet."+ case .inTheCloud: "Peel won’t move this: it syncs with iCloud or another cloud service, and moving it to the Trash would also remove it from the cloud and from your other devices."case .holdsDocuments: "Peel won’t move this: an app’s documents are inside."case .holdsALibrary: "Peel won’t move this: a photo, music, or video library is inside."case .holdsWorkKeptInACache: "Peel won’t move this: an app keeps work inside that exists nowhere else, such as an editor’s local history."@@ -310,7 +311,7 @@ extension HoldBack {case .crashReport:"Not selected: a report macOS wrote when the app crashed, which its developer may still ask you for."case .inTheCloud:- "Not selected: this is in iCloud Drive, so moving it to the Trash removes it from iCloud and from your other devices."+ "Left alone: this syncs with iCloud or another cloud service, and moving it to the Trash would also remove it from the cloud and from your other devices."case .openInAProgram:"Not selected: a program has this open right now, and may still be downloading it."case .changedRecently:diff --git a/SAFETY.md b/SAFETY.mdindex c5786d40..c05e7ed2 100644--- a/SAFETY.md+++ b/SAFETY.md@@ -75,6 +75,10 @@ library along, and the row says so instead of failing when you press the button.wallet in it stays the same way, and so does a folder that holds one a level or two down: see[Crypto wallets](#crypto-wallets).+Anything that syncs to iCloud or another cloud service stays too, wherever it is, such as what is on your Desktop and+in Documents when they are in iCloud Drive: the Trash would take it from the cloud and from your other devices. Its+row says so, and File Search doesn't list it.+Also refused: work that an app keeps inside a *cache* folder and nowhere else. A JetBrains IDE and AndroidStudio record your unsaved edits in `LocalHistory`, beside their caches, and Deno keeps `localStorage` and itskey-value databases in `location_data`. Those folders, and any cache folder that holds one, stay: emptying@@ -312,7 +316,7 @@ Never selected for you, even when found:source says it keeps them, and anything named as an app's backups. When you uninstall Xcode, the simulators it made inyour home folder are listed too, with the apps installed in them and their data, and never selected.- A copy Mail keeps of an attachment you opened, which you may have changed.-- A file in iCloud Drive, which the Trash would take from every device, and a file a program has open right now.+- A file a program has open right now.- An installer package an app keeps in Application Support, which the app may still need, and an update whose app isrunning, which may install it when the app quits.- An encrypted disk image, and a disk image, package, or archive outside Downloads that isn't an installed app's