Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Say why History can't be written, and set an unreadable journal aside

Țugui Dragoș45429c5a0503
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstrings
index cc08765a..b1e1b146 100644
--- a/Localization/Peel/Localizable.xcstrings
+++ b/Localization/Peel/Localizable.xcstrings
@@ -139066,108 +139066,108 @@
}
}
},
- "Peel couldn’t write to History, because the disk is full or Peel’s folder can’t be written, and it moves nothing it can’t put back." : {
+ "Peel couldn’t write to History then, and it moves nothing it can’t put back." : {
"localizations" : {
"cs" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel nemohl zapsat do Historie, protože disk je plný nebo do složky Peelu nelze zapisovat, a nepřesouvá nic, co nemůže vrátit zpět."
+ "value" : "Peel tehdy nemohl zapsat do Historie a nepřesouvá nic, co nemůže vrátit zpět."
}
},
"de" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel konnte nicht in den Verlauf schreiben, weil das Volume voll ist oder in den Peel-Ordner nicht geschrieben werden kann, und verschiebt nichts, was sich nicht zurücklegen lässt."
+ "value" : "Peel konnte zu diesem Zeitpunkt nicht in den Verlauf schreiben und verschiebt nichts, was sich nicht zurücklegen lässt."
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel no ha podido escribir en Historial, porque el disco está lleno o no se puede escribir en la carpeta de Peel, y no traslada nada que no pueda restaurar."
+ "value" : "En ese momento, Peel no podía escribir en Historial, y no traslada nada que no pueda restaurar."
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel n’a pas pu écrire dans l’Historique, car le disque est plein ou le dossier de Peel n’est pas accessible en écriture, et il ne déplace rien qu’il ne pourrait pas remettre en place."
+ "value" : "Peel n’a pas pu écrire dans l’Historique à ce moment-là, et il ne déplace rien qu’il ne pourrait pas remettre en place."
}
},
"it" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel non è riuscito a scrivere nella Cronologia, perché il disco è pieno o non è possibile scrivere nella cartella di Peel, e non sposta nulla che non possa ripristinare."
+ "value" : "Peel non è riuscito a scrivere nella Cronologia in quel momento, e non sposta nulla che non possa ripristinare."
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peelは履歴に書き込めませんでした。ディスクがいっぱいになっているか、Peelのフォルダに書き込めないためです。戻せないものは何も移動しません。"
+ "value" : "その時点でPeelは履歴に書き込めませんでした。戻せないものは何も移動しません。"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "디스크가 가득 찼거나 Peel의 폴더에 쓸 수 없기 때문에 Peel이 기록을 쓸 수 없었으며, 되돌려 놓을 수 없는 것은 아무것도 이동하지 않습니다."
+ "value" : "당시에는 Peel이 기록을 쓸 수 없었으며, 되돌려 놓을 수 없는 것은 아무것도 이동하지 않습니다."
}
},
"nl" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel kon niet naar Geschiedenis schrijven, omdat de schijf vol is of er niet naar de map van Peel kan worden geschreven, en Peel verplaatst niets wat het niet kan terugzetten."
+ "value" : "Peel kon op dat moment niet naar Geschiedenis schrijven en verplaatst niets wat het niet kan terugzetten."
}
},
"pl" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel nie mógł zapisać Historii, ponieważ dysk jest pełny albo nie można zapisywać w folderze Peel, i nie przenosi niczego, czego nie może przywrócić."
+ "value" : "Peel nie mógł wtedy zapisać Historii i nie przenosi niczego, czego nie może przywrócić."
}
},
"pt" : {
"stringUnit" : {
"state" : "translated",
- "value" : "O Peel não conseguiu gravar no Histórico, porque o disco está cheio ou não é possível gravar na pasta do Peel, e não move nada que não possa colocar de volta."
+ "value" : "O Peel não conseguiu gravar no Histórico naquele momento, e não move nada que não possa colocar de volta."
}
},
"ro" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel nu a putut scrie în Istoric, deoarece discul este plin sau nu se poate scrie în dosarul Peel, și nu mută nimic din ce nu poate pune înapoi."
+ "value" : "Peel nu a putut scrie atunci în Istoric și nu mută nimic din ce nu poate pune înapoi."
}
},
"ru" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel не удалось записать Историю, так как диск заполнен или запись в папку Peel невозможна, а он не перемещает ничего, что не сможет восстановить."
+ "value" : "В тот момент Peel не удалось записать Историю, а он не перемещает ничего, что не сможет восстановить."
}
},
"sv" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel kunde inte skriva till Historik, eftersom skivan är full eller det inte går att skriva till Peels mapp, och flyttar inget som den inte kan lägga tillbaka."
+ "value" : "Peel kunde inte skriva till Historik just då och flyttar inget som den inte kan lägga tillbaka."
}
},
"tr" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel, disk dolu olduğu veya Peel’in klasörüne yazılamadığı için Geçmiş’e yazamadı ve yerine koyamayacağı hiçbir şeyi taşımaz."
+ "value" : "Peel, o sırada Geçmiş’e yazamadı ve yerine koyamayacağı hiçbir şeyi taşımaz."
}
},
"uk" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel не змогла записати в Історію, бо диск переповнений або папка Peel недоступна для запису, і Peel не переміщує нічого, чого не може повернути."
+ "value" : "Peel тоді не змогла записати в Історію, і Peel не переміщує нічого, чого не може повернути."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel无法写入“历史记录”,因为磁盘已满或Peel的文件夹无法写入,而它不会移动任何无法放回原处的内容。"
+ "value" : "Peel当时未能写入“历史记录”,而它不会移动任何无法放回原处的内容。"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel無法寫入「歷史記錄」,因為磁碟已滿或Peel的檔案夾無法寫入,而它不會移動任何無法還原的項目。"
+ "value" : "Peel當時無法寫入「歷史記錄」,而它不會移動任何無法還原的項目。"
}
}
}
@@ -184911,6 +184911,112 @@
}
}
},
+ "Something Peel can’t use stands at %@, where it writes down each move, and Peel couldn’t set it aside. Peel removes nothing until it’s gone, so that everything it moves can be put back." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "V umístění %@, kde Peel zaznamenává každé přesunutí, je něco, co Peel nemůže použít a co se mu nepodařilo odložit stranou. Dokud to tam bude, Peel nic neodstraní, aby vše, co přesune, šlo vrátit zpět."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Unter %@, wo Peel jedes Verschieben festhält, liegt etwas, das Peel nicht verwenden kann, und Peel konnte es nicht beiseitelegen. Peel entfernt nichts, solange es dort liegt, damit sich alles, was Peel verschiebt, zurücklegen lässt."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Hay algo que Peel no puede usar en %@, donde anota cada traslado, y no ha podido apartarlo. Peel no elimina nada hasta que ya no esté ahí, para que todo lo que traslade se pueda restaurar."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "À l’emplacement %@, où Peel consigne chaque déplacement, se trouve un élément qu’il ne peut pas utiliser et qu’il n’a pas pu mettre de côté. Peel ne supprime rien tant que cet élément est là, afin que tout ce qu’il déplace puisse être remis en place."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "In %@, dove Peel annota ogni spostamento, c’è qualcosa che Peel non può usare, e Peel non è riuscito a metterlo da parte. Peel non rimuove nulla finché resta lì, in modo che tutto ciò che sposta si possa ripristinare."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "移動のたびに記録を書き込む%@に、Peelが使用できないものがあり、それを別に保管することもできませんでした。それがなくなるまで、Peelは何もゴミ箱に入れません。移動するものをすべて戻せるようにするためです。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel이 각 이동 내역을 적어 두는 %@에 Peel이 사용할 수 없는 항목이 있으며, 이 항목을 따로 보관할 수 없었습니다. 이 항목이 없어지기 전까지 Peel은 이동하는 모든 항목을 되돌려 놓을 수 있도록 아무것도 제거하지 않습니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Op %@, waar Peel elke verplaatsing noteert, staat iets wat Peel niet kan gebruiken, en Peel kon het niet apart zetten. Peel verwijdert niets totdat het weg is, zodat alles wat Peel verplaatst, kan worden teruggezet."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Pod ścieżką %@, gdzie Peel notuje każde przeniesienie, jest coś, czego Peel nie może użyć i czego nie udało mu się odłożyć na bok. Peel niczego nie przeniesie do Kosza, dopóki to stamtąd nie zniknie, aby wszystko, co przeniesie, można było przywrócić."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Algo que o Peel não consegue usar está em %@, onde ele registra cada item que move, e o Peel não conseguiu guardá-lo à parte. O Peel não remove nada enquanto isso estiver lá, para que tudo o que ele mover possa ser colocado de volta."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "La %@, unde Peel notează fiecare mutare, se află ceva pe care Peel nu îl poate folosi, iar Peel nu l‑a putut pune deoparte. Peel nu elimină nimic până când acesta nu dispare, pentru ca tot ce mută să poată fi pus înapoi."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "По пути %@, где Peel фиксирует каждое перемещение, находится что-то, чем он не может воспользоваться, и сохранить это отдельно ему не удалось. Peel ничего не удаляет, пока это не будет убрано, чтобы все, что он перемещает, можно было восстановить."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Något som Peel inte kan använda finns på %@, där Peel antecknar varje flytt, och Peel kunde inte lägga undan det. Peel tar inte bort något förrän det är borta, så att allt som Peel flyttar kan läggas tillbaka."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel’in her taşımayı kaydettiği %@ konumunda, kullanamadığı bir şey duruyor ve Peel onu bir kenara ayıramadı. Peel, o şey ortadan kalkana kadar hiçbir şeyi kaldırmaz, böylece taşıyacağı her şey yerine konabilir."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "За шляхом %@, де Peel веде запис кожного переміщення, є щось, чим Peel не може скористатися, і Peel не вдалося його відкласти. Peel нічого не вилучає, доки воно там є, щоб усе, що Peel переміщує, можна було повернути."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel在%@记录每次移动,但那里有一个Peel无法使用的项目,而Peel未能将其移到一旁。在它被移走之前,Peel不会移除任何内容,以确保它移动的所有内容都能放回原处。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel會在%@記下每一次移動,但那裡有一個它無法使用的項目,而且Peel無法將它移到一旁。在該項目移走之前,Peel不會移除任何項目,以確保它移動的所有項目都能還原。"
+ }
+ }
+ }
+ },
"Something else is at %@, and Peel offers no command that would replace it." : {
"localizations" : {
"cs" : {
@@ -200722,108 +200828,114 @@
}
}
},
- "The disk is full, or Peel’s folder can’t be written. Peel removes nothing until it can, so that everything it moves can be put back." : {
+ "The disk that holds Peel’s folder has %@ free, and writing History needs %@. Peel removes nothing until there is room, so that everything it moves can be put back." : {
"localizations" : {
"cs" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Disk je plný nebo do složky Peelu nelze zapisovat. Dokud nebude moci zapisovat, Peel nic neodstraní, aby vše, co přesune, šlo vrátit zpět."
+ "value" : "Na disku se složkou Peelu zbývá %1$@ volného místa a zápis do Historie vyžaduje %2$@. Dokud nebude dost místa, Peel nic neodstraní, aby vše, co přesune, šlo vrátit zpět."
}
},
"de" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Das Volume ist voll, oder in den Peel-Ordner kann nicht geschrieben werden. Peel entfernt nichts, solange das so ist, damit sich alles, was Peel verschiebt, zurücklegen lässt."
+ "value" : "Das Volume, auf dem der Peel-Ordner liegt, hat %@ freien Speicherplatz, und das Schreiben des Verlaufs benötigt %@. Peel entfernt nichts, bis genug Platz frei ist, damit sich alles, was Peel verschiebt, zurücklegen lässt."
+ }
+ },
+ "en" : {
+ "stringUnit" : {
+ "state" : "new",
+ "value" : "The disk that holds Peel’s folder has %1$@ free, and writing History needs %2$@. Peel removes nothing until there is room, so that everything it moves can be put back."
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
- "value" : "El disco está lleno o no se puede escribir en la carpeta de Peel. Peel no elimina nada hasta que pueda escribir en Historial, para que todo lo que traslade se pueda restaurar."
+ "value" : "El disco donde está la carpeta de Peel tiene %@ de espacio libre, y escribir en Historial requiere %@. Peel no elimina nada hasta que haya espacio, para que todo lo que traslade se pueda restaurar."
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Le disque est plein, ou le dossier de Peel n’est pas accessible en écriture. Peel ne supprime rien tant qu’il ne peut pas y écrire, afin que tout ce qu’il déplace puisse être remis en place."
+ "value" : "Le disque qui contient le dossier de Peel dispose de %1$@ d’espace libre, et l’écriture de l’Historique nécessite %2$@. Peel ne supprime rien tant qu’il n’y a pas assez de place, afin que tout ce qu’il déplace puisse être remis en place."
}
},
"it" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Il disco è pieno, oppure non è possibile scrivere nella cartella di Peel. Peel non rimuove nulla finché non riesce a scrivere nella Cronologia, in modo che tutto ciò che sposta si possa ripristinare."
+ "value" : "Il disco che contiene la cartella di Peel ha %@ di spazio libero, e per scrivere la Cronologia servono %@. Peel non rimuove nulla finché non c’è spazio, in modo che tutto ciò che sposta si possa ripristinare."
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "ディスクがいっぱいになっているか、Peelのフォルダに書き込めない状態です。書き込めるようになるまで、Peelは何もゴミ箱に入れません。移動するものをすべて戻せるようにするためです。"
+ "value" : "Peelのフォルダがあるディスクの空き領域は%@で、履歴の書き込みには%@が必要です。空き領域ができるまで、Peelは何もゴミ箱に入れません。移動するものをすべて戻せるようにするためです。"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "디스크가 가득 찼거나 Peel의 폴더에 쓸 수 없습니다. 기록을 쓸 수 있게 되기 전까지 Peel은 이동하는 모든 항목을 되돌려 놓을 수 있도록 아무것도 제거하지 않습니다."
+ "value" : "Peel의 폴더가 있는 디스크에 %@의 공간이 남아 있지만, 기록을 쓰려면 %@의 공간이 필요합니다. 공간이 생기기 전까지 Peel은 이동하는 모든 항목을 되돌려 놓을 수 있도록 아무것도 제거하지 않습니다."
}
},
"nl" : {
"stringUnit" : {
"state" : "translated",
- "value" : "De schijf is vol of er kan niet naar de map van Peel worden geschreven. Peel verwijdert niets totdat het weer kan schrijven, zodat alles wat Peel verplaatst, kan worden teruggezet."
+ "value" : "Op de schijf waarop de map van Peel staat, is %@ vrij, en voor het schrijven naar Geschiedenis is %@ nodig. Peel verwijdert niets totdat er ruimte is, zodat alles wat Peel verplaatst, kan worden teruggezet."
}
},
"pl" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Dysk jest pełny albo nie można zapisywać w folderze Peel. Peel niczego nie przeniesie do Kosza, dopóki nie będzie mógł zapisać Historii, aby wszystko, co przeniesie, można było przywrócić."
+ "value" : "Dysk, na którym jest folder Peel, ma %@ wolnego miejsca, a do zapisania Historii potrzeba %@. Peel niczego nie przeniesie do Kosza, dopóki nie będzie miejsca, aby wszystko, co przeniesie, można było przywrócić."
}
},
"pt" : {
"stringUnit" : {
"state" : "translated",
- "value" : "O disco está cheio, ou não é possível gravar na pasta do Peel. O Peel não remove nada até conseguir gravar, para que tudo o que ele mover possa ser colocado de volta."
+ "value" : "O disco que contém a pasta do Peel tem %@ de espaço livre, e gravar o Histórico requer %@. O Peel não remove nada até que haja espaço, para que tudo o que ele mover possa ser colocado de volta."
}
},
"ro" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Discul este plin sau nu se poate scrie în dosarul Peel. Peel nu elimină nimic până când nu poate scrie, pentru ca tot ce mută să poată fi pus înapoi."
+ "value" : "Discul pe care se află dosarul Peel are %@ liberi, iar scrierea Istoricului necesită %@. Peel nu elimină nimic până când nu există suficient spațiu, pentru ca tot ce mută să poată fi pus înapoi."
}
},
"ru" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Диск заполнен, или запись в папку Peel невозможна. Peel ничего не удаляет, пока запись не станет возможной, чтобы все, что он перемещает, можно было восстановить."
+ "value" : "На диске, где находится папка Peel, свободно %1$@, а для записи Истории нужно %2$@. Peel ничего не удаляет, пока не освободится место, чтобы все, что он перемещает, можно было восстановить."
}
},
"sv" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Skivan är full, eller så går det inte att skriva till Peels mapp. Peel tar inte bort något förrän det går, så att allt som Peel flyttar kan läggas tillbaka."
+ "value" : "Skivan som innehåller Peels mapp har %@ ledigt, och det behövs %@ för att skriva Historik. Peel tar inte bort något förrän det finns plats, så att allt som Peel flyttar kan läggas tillbaka."
}
},
"tr" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Disk dolu veya Peel’in klasörüne yazılamıyor. Peel, Geçmiş’e yazabilene kadar hiçbir şeyi kaldırmaz, böylece taşıyacağı her şey yerine konabilir."
+ "value" : "Peel’in klasörünü barındıran diskte %@ boş yer var, Geçmiş’e yazmak içinse %@ gerekiyor. Peel, yeterli yer olana kadar hiçbir şeyi kaldırmaz, böylece taşıyacağı her şey yerine konabilir."
}
},
"uk" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Диск переповнений, або папка Peel недоступна для запису. Peel нічого не вилучає, доки не зможе записувати в Історію, щоб усе, що Peel переміщує, можна було повернути."
+ "value" : "На диску, де лежить папка Peel, вільно %@, а для запису Історії потрібно %@. Peel нічого не вилучає, доки не зʼявиться місце, щоб усе, що Peel переміщує, можна було повернути."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "磁盘已满,或者Peel的文件夹无法写入。在能够写入之前,Peel不会移除任何内容,以确保它移动的所有内容都能放回原处。"
+ "value" : "Peel的文件夹所在的磁盘有%@可用空间,而写入“历史记录”需要%@。在有足够的空间之前,Peel不会移除任何内容,以确保它移动的所有内容都能放回原处。"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
- "value" : "磁碟已滿,或Peel的檔案夾無法寫入。在能夠寫入之前,Peel不會移除任何項目,以確保它移動的所有項目都能還原。"
+ "value" : "Peel的檔案夾所在的磁碟有%@可用空間,而寫入「歷史記錄」需要%@。在有足夠空間之前,Peel不會移除任何項目,以確保它移動的所有項目都能還原。"
}
}
}
@@ -210585,6 +210697,218 @@
}
}
},
+ "This account can’t write %@, where Peel writes down each move. Peel removes nothing until it can, so that everything it moves can be put back." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Tento účet nemůže zapisovat do souboru %@, do kterého Peel zaznamenává každé přesunutí. Dokud nebude moci zapisovat, Peel nic neodstraní, aby vše, co přesune, šlo vrátit zpět."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Dieser Benutzeraccount kann nicht in %@ schreiben, wo Peel jedes Verschieben festhält. Peel entfernt nichts, solange das so ist, damit sich alles, was Peel verschiebt, zurücklegen lässt."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Esta cuenta no puede escribir en %@, donde Peel anota cada traslado. Peel no elimina nada hasta que pueda escribir ahí, para que todo lo que traslade se pueda restaurar."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Ce compte ne peut pas écrire dans %@, où Peel consigne chaque déplacement. Peel ne supprime rien tant qu’il ne peut pas y écrire, afin que tout ce qu’il déplace puisse être remis en place."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Questo account non può scrivere in %@, dove Peel annota ogni spostamento. Peel non rimuove nulla finché non potrà scriverci, in modo che tutto ciò che sposta si possa ripristinare."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "このアカウントでは、Peelが移動のたびに記録を書き込む%@に書き込めません。書き込めるようになるまで、Peelは何もゴミ箱に入れません。移動するものをすべて戻せるようにするためです。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "이 계정은 Peel이 각 이동 내역을 적어 두는 %@에 쓸 수 없습니다. 쓸 수 있게 되기 전까지 Peel은 이동하는 모든 항목을 되돌려 놓을 수 있도록 아무것도 제거하지 않습니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Deze account kan niet naar %@ schrijven, waar Peel elke verplaatsing noteert. Peel verwijdert niets totdat dat wel kan, zodat alles wat Peel verplaatst, kan worden teruggezet."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "To konto nie może zapisywać w pliku %@, w którym Peel notuje każde przeniesienie. Peel niczego nie przeniesie do Kosza, dopóki nie będzie to możliwe, aby wszystko, co przeniesie, można było przywrócić."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Esta conta não pode gravar em %@, onde o Peel registra cada item que move. O Peel não remove nada até conseguir gravar, para que tudo o que ele mover possa ser colocado de volta."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Acest cont nu poate scrie în %@, unde Peel notează fiecare mutare. Peel nu elimină nimic până când nu poate scrie acolo, pentru ca tot ce mută să poată fi pus înapoi."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Эта учетная запись не может записывать в файл %@, где Peel фиксирует каждое перемещение. Peel ничего не удаляет, пока запись не станет возможной, чтобы все, что он перемещает, можно было восстановить."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Det här kontot kan inte skriva till %@, där Peel antecknar varje flytt. Peel tar inte bort något förrän det går, så att allt som Peel flyttar kan läggas tillbaka."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Bu hesap, Peel’in her taşımayı kaydettiği %@ dosyasına yazamıyor. Peel, yazabilene kadar hiçbir şeyi kaldırmaz, böylece taşıyacağı her şey yerine konabilir."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Цей обліковий запис не може записувати в %@, де Peel веде запис кожного переміщення. Peel нічого не вилучає, доки не зможе туди записувати, щоб усе, що Peel переміщує, можна було повернути."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "此账户无法写入%@,而Peel会在那里记录每次移动。在能够写入之前,Peel不会移除任何内容,以确保它移动的所有内容都能放回原处。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "此帳號無法寫入%@,而Peel會在那裡記下每一次移動。在能夠寫入之前,Peel不會移除任何項目,以確保它移動的所有項目都能還原。"
+ }
+ }
+ }
+ },
+ "This account can’t write to %@, where Peel keeps History. Peel removes nothing until it can, so that everything it moves can be put back." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Tento účet nemůže zapisovat do složky %@, kde Peel uchovává Historii. Dokud nebude moci zapisovat, Peel nic neodstraní, aby vše, co přesune, šlo vrátit zpět."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Dieser Benutzeraccount kann nicht in %@ schreiben, wo Peel den Verlauf aufbewahrt. Peel entfernt nichts, solange das so ist, damit sich alles, was Peel verschiebt, zurücklegen lässt."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Esta cuenta no puede escribir en %@, donde Peel guarda Historial. Peel no elimina nada hasta que pueda escribir ahí, para que todo lo que traslade se pueda restaurar."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Ce compte ne peut pas écrire dans %@, où Peel conserve l’Historique. Peel ne supprime rien tant qu’il ne peut pas y écrire, afin que tout ce qu’il déplace puisse être remis en place."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Questo account non può scrivere in %@, dove Peel conserva la Cronologia. Peel non rimuove nulla finché non potrà scriverci, in modo che tutto ciò che sposta si possa ripristinare."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "このアカウントでは、Peelが履歴を保管している%@に書き込めません。書き込めるようになるまで、Peelは何もゴミ箱に入れません。移動するものをすべて戻せるようにするためです。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "이 계정은 Peel이 기록을 보관하는 %@에 쓸 수 없습니다. 쓸 수 있게 되기 전까지 Peel은 이동하는 모든 항목을 되돌려 놓을 수 있도록 아무것도 제거하지 않습니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Deze account kan niet naar %@ schrijven, waar Peel Geschiedenis bewaart. Peel verwijdert niets totdat dat wel kan, zodat alles wat Peel verplaatst, kan worden teruggezet."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "To konto nie może zapisywać w folderze %@, w którym Peel przechowuje Historię. Peel niczego nie przeniesie do Kosza, dopóki nie będzie to możliwe, aby wszystko, co przeniesie, można było przywrócić."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Esta conta não pode gravar em %@, onde o Peel guarda o Histórico. O Peel não remove nada até conseguir gravar, para que tudo o que ele mover possa ser colocado de volta."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Acest cont nu poate scrie în %@, unde Peel păstrează Istoricul. Peel nu elimină nimic până când nu poate scrie acolo, pentru ca tot ce mută să poată fi pus înapoi."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Эта учетная запись не может записывать в папку %@, где Peel хранит Историю. Peel ничего не удаляет, пока запись не станет возможной, чтобы все, что он перемещает, можно было восстановить."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Det här kontot kan inte skriva till %@, där Peel sparar Historik. Peel tar inte bort något förrän det går, så att allt som Peel flyttar kan läggas tillbaka."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Bu hesap, Peel’in Geçmiş’i tuttuğu %@ klasörüne yazamıyor. Peel, yazabilene kadar hiçbir şeyi kaldırmaz, böylece taşıyacağı her şey yerine konabilir."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Цей обліковий запис не може записувати в папку %@, де Peel зберігає Історію. Peel нічого не вилучає, доки не зможе туди записувати, щоб усе, що Peel переміщує, можна було повернути."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "此账户无法写入%@,而Peel在那里保存“历史记录”。在能够写入之前,Peel不会移除任何内容,以确保它移动的所有内容都能放回原处。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "此帳號無法寫入%@,而Peel會將「歷史記錄」存放在那裡。在能夠寫入之前,Peel不會移除任何項目,以確保它移動的所有項目都能還原。"
+ }
+ }
+ }
+ },
"This account doesn’t use iCloud Drive on this Mac, so there is nothing here to free." : {
"localizations" : {
"cs" : {
@@ -256226,6 +256550,112 @@
}
}
},
+ "macOS didn’t say how much room is free on the disk that holds %@. Peel removes nothing until it knows, so that everything it moves can be put back." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Systém macOS neuvedl, kolik volného místa je na disku se složkou %@. Dokud to Peel nebude vědět, nic neodstraní, aby vše, co přesune, šlo vrátit zpět."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS hat nicht mitgeteilt, wie viel Platz auf dem Volume frei ist, auf dem %@ liegt. Peel entfernt nichts, solange das unbekannt ist, damit sich alles, was Peel verschiebt, zurücklegen lässt."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS no ha dicho cuánto espacio libre hay en el disco donde está %@. Peel no elimina nada hasta que lo sepa, para que todo lo que traslade se pueda restaurar."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS n’a pas indiqué l’espace disponible sur le disque qui contient %@. Peel ne supprime rien tant qu’il ne le sait pas, afin que tout ce qu’il déplace puisse être remis en place."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS non ha indicato quanto spazio è libero sul disco che contiene %@. Peel non rimuove nulla finché non lo sa, in modo che tutto ciò che sposta si possa ripristinare."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOSは、%@があるディスクの空き領域を報告しませんでした。空き領域がわかるまで、Peelは何もゴミ箱に入れません。移動するものをすべて戻せるようにするためです。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS가 %@이(가) 있는 디스크에 사용 가능한 공간이 얼마인지 알려 주지 않았습니다. 이를 알 수 있게 되기 전까지 Peel은 이동하는 모든 항목을 되돌려 놓을 수 있도록 아무것도 제거하지 않습니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS heeft niet gemeld hoeveel ruimte er vrij is op de schijf waarop %@ staat. Peel verwijdert niets totdat het dat weet, zodat alles wat Peel verplaatst, kan worden teruggezet."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS nie podał, ile wolnego miejsca ma dysk, na którym jest folder %@. Peel niczego nie przeniesie do Kosza, dopóki się tego nie dowie, aby wszystko, co przeniesie, można było przywrócić."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "O macOS não informou quanto espaço livre há no disco que contém %@. O Peel não remove nada até saber, para que tudo o que ele mover possa ser colocado de volta."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS nu a spus cât spațiu este liber pe discul pe care se află %@. Peel nu elimină nimic până când nu află, pentru ca tot ce mută să poată fi pus înapoi."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS не сообщила, сколько свободного места на диске, где находится %@. Peel ничего не удаляет, пока не узнает этого, чтобы все, что он перемещает, можно было восстановить."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS sa inte hur mycket utrymme som är ledigt på skivan som innehåller %@. Peel tar inte bort något förrän det är känt, så att allt som Peel flyttar kan läggas tillbaka."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS, %@ klasörünü barındıran diskte ne kadar boş yer olduğunu söylemedi. Peel, bunu öğrenene kadar hiçbir şeyi kaldırmaz, böylece taşıyacağı her şey yerine konabilir."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS не повідомила, скільки вільного місця на диску, де лежить %@. Peel нічого не вилучає, доки цього не знатиме, щоб усе, що Peel переміщує, можна було повернути."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS没有说明%@所在的磁盘还有多少可用空间。在得知之前,Peel不会移除任何内容,以确保它移动的所有内容都能放回原处。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS沒有說明%@所在的磁碟還有多少可用空間。在得知之前,Peel不會移除任何項目,以確保它移動的所有項目都能還原。"
+ }
+ }
+ }
+ },
"macOS didn’t say what this package installed, so Peel can’t tell what is left." : {
"localizations" : {
"cs" : {
diff --git a/Packages/PeelCore/Sources/PeelCommandLine/Commands/HistoryCommands.swift b/Packages/PeelCore/Sources/PeelCommandLine/Commands/HistoryCommands.swift
index f02af266..3325e894 100644
--- a/Packages/PeelCore/Sources/PeelCommandLine/Commands/HistoryCommands.swift
+++ b/Packages/PeelCore/Sources/PeelCommandLine/Commands/HistoryCommands.swift
@@ -415,8 +415,8 @@ struct RestoreCommand: AsyncParsableCommand {
return
}
// As for a move: History would go on listing what came back.
- guard RemovalLog.canBeWritten(at: log.url) else {
- throw CommandFailure("Nothing was put back. \(TrashFailure.Reason.historyCannotBeWritten.summary).")
+ if let problem = RemovalLog.writeProblem(at: log.url) {
+ throw CommandFailure("Nothing was put back. \(TrashFailure.Reason.historyCannotBeWritten(problem).summary).")
}
if !yes {
try Output.confirm("Put \(Output.count(going.count, "item", "items")) back?")
diff --git a/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift b/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift
index e56cfccf..6e52d2f9 100644
--- a/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift
+++ b/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift
@@ -532,6 +532,20 @@ extension PrivacyReset.Result {
}
}
+extension HistoryWriteProblem {
+ var summary: String {
+ switch self {
+ case .folderNotWritable(let folder): "this account can't write \(Output.path(folder))"
+ case .diskFull(let free, let needed):
+ "the disk has \(Output.size(free)) free, and writing History needs \(Output.size(needed))"
+ case .freeSpaceNotKnown(let folder):
+ "macOS didn't say how much room is free on the disk that holds \(Output.path(folder))"
+ case .journalUnreadable(let journal): "\(Output.path(journal)) isn't a journal Peel can read"
+ case .journalNotWritable(let journal): "this account can't write \(Output.path(journal))"
+ }
+ }
+}
+
extension TrashFailure.Reason {
var summary: String {
switch self {
@@ -546,7 +560,8 @@ extension TrashFailure.Reason {
case .movedWithoutATrace: "in the Trash where macOS didn't say, so only Finder can put it back"
case .somethingElseMoved(let name): "something else was at that path; it is in the Trash as \(Output.plain(name))"
case .historyUnreadable: "History can't be read"
- case .historyCannotBeWritten: "History can't be written: the disk is full, or Peel's folder can't be written"
+ case .historyCannotBeWritten(let problem?): "History can't be written: \(problem.summary)"
+ case .historyCannotBeWritten(nil): "History can't be written"
case .peelRemovesItself: "Peel is removing itself"
case .heldOpen(let processes) where processes.count > 1:
"in use by \(processes.map(Output.plain).joined(separator: ", ")); quit them, then try again"
diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/HistoryWriteProblem.swift b/Packages/PeelCore/Sources/PeelCore/Removal/HistoryWriteProblem.swift
new file mode 100644
index 00000000..a05af15e
--- /dev/null
+++ b/Packages/PeelCore/Sources/PeelCore/Removal/HistoryWriteProblem.swift
@@ -0,0 +1,44 @@
+public import Foundation
+
+/// Why History can't be written now: what Peel found, and where, so that what it says names the cause.
+public enum HistoryWriteProblem: Sendable, Hashable {
+ /// This account can't write `folder`, the folder History is kept in, or the nearest folder there is on its way.
+ case folderNotWritable(URL)
+ /// The disk holding History has `free` bytes, fewer than the `needed` a safe write of History takes.
+ case diskFull(free: Int64, needed: Int64)
+ case freeSpaceNotKnown(URL)
+ /// What stands where the journal goes doesn't open as the journal: a folder, a link, or a file too big.
+ case journalUnreadable(URL)
+ case journalNotWritable(URL)
+}
+
+extension HistoryWriteProblem {
+ /// The problem as the refusal log keeps it beside the reason's name: a word for the case, then what it names, a
+ /// line each.
+ var detail: String {
+ switch self {
+ case .folderNotWritable(let folder): "folder\n" + folder.path(percentEncoded: false)
+ case .diskFull(let free, let needed): "disk\n\(free)\n\(needed)"
+ case .freeSpaceNotKnown(let folder): "free-space\n" + folder.path(percentEncoded: false)
+ case .journalUnreadable(let journal): "journal\n" + journal.path(percentEncoded: false)
+ case .journalNotWritable(let journal): "journal-write\n" + journal.path(percentEncoded: false)
+ }
+ }
+
+ /// The problem a refusal log stored as `detail`, or nil for one this version can't read.
+ init?(detail: String) {
+ let lines = detail.split(separator: "\n", omittingEmptySubsequences: false).map(String.init)
+ guard lines.count >= 2 else { return nil }
+ let path = URL(filePath: lines[1])
+ switch lines[0] {
+ case "folder": self = .folderNotWritable(path)
+ case "disk":
+ guard lines.count == 3, let free = Int64(lines[1]), let needed = Int64(lines[2]) else { return nil }
+ self = .diskFull(free: free, needed: needed)
+ case "free-space": self = .freeSpaceNotKnown(path)
+ case "journal": self = .journalUnreadable(path)
+ case "journal-write": self = .journalNotWritable(path)
+ default: return nil
+ }
+ }
+}
diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/RemovalJournal.swift b/Packages/PeelCore/Sources/PeelCore/Removal/RemovalJournal.swift
index 28e1019c..0b131dad 100644
--- a/Packages/PeelCore/Sources/PeelCore/Removal/RemovalJournal.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Removal/RemovalJournal.swift
@@ -91,9 +91,17 @@ struct RemovalJournal: Sendable {
self.history = history
}
- /// Whether a line can be written here: there is no journal yet, or it opens as the file it should be.
- var canBeWritten: Bool {
- url.isMissing || (canBeRead && access(url.path(percentEncoded: false), W_OK) == 0)
+ /// Why a line can't be written here, or nil when it can: there is no journal yet, or it opens as the file it should
+ /// be and this account can write it.
+ var writeProblem: HistoryWriteProblem? {
+ if url.isMissing { return nil }
+ guard canBeRead else { return .journalUnreadable(url) }
+ return access(url.path(percentEncoded: false), W_OK) == 0 ? nil : .journalNotWritable(url)
+ }
+
+ /// Whether something stands where the journal goes that doesn't open as one, which is kept aside.
+ var isUnreadable: Bool {
+ !url.isMissing && !canBeRead
}
private var canBeRead: Bool {
@@ -103,7 +111,7 @@ struct RemovalJournal: Sendable {
/// Keeps a journal that can't be read beside a new one, under another name, and answers that name: while it stands
/// in its place, what a removal cut short leaves behind would be lost.
func setAsideIfUnreadable() -> URL? {
- guard !url.isMissing, !canBeRead else { return nil }
+ guard isUnreadable else { return nil }
return DamagedFile.setAside(url)
}
@@ -112,8 +120,8 @@ struct RemovalJournal: Sendable {
RemovalLog.canBeRead(at: history)
}
- var historyCanBeWritten: Bool {
- RemovalLog.canBeWritten(at: history)
+ var historyWriteProblem: HistoryWriteProblem? {
+ RemovalLog.writeProblem(at: history)
}
/// Writes down `items`, which moved together in `batch`, or in the removal and part `recorded` names, one line
diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/RemovalLog.swift b/Packages/PeelCore/Sources/PeelCore/Removal/RemovalLog.swift
index 63affec4..49928936 100644
--- a/Packages/PeelCore/Sources/PeelCore/Removal/RemovalLog.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Removal/RemovalLog.swift
@@ -64,6 +64,19 @@ public actor RemovalLog {
FileLock.whileReading(beside: url) { outcome(current()) }
}
+ /// Keeps a journal that can't be read aside, as a read of History does, so it holds no removal back, and answers
+ /// the problem the log has then.
+ public func setAsideAnUnreadableJournal() -> RemovalLogProblem? {
+ if journal.isUnreadable { whileNoOtherProcessWrites { keepAsideAnUnreadableJournal() } }
+ return problem
+ }
+
+ private func keepAsideAnUnreadableJournal() {
+ if let setAside = journal.setAsideIfUnreadable() {
+ note(.damaged(setAside: setAside))
+ }
+ }
+
/// The places in the Trash where an item Peel moved still is, whichever process moved it: what History records
/// and what a removal under way has written down so far. Spelled as `PathPattern.comparablePath` spells them.
public func placesInTheTrash() -> Set<String> {
@@ -125,18 +138,21 @@ public actor RemovalLog {
url.isMissing || BoundedRead.opens(url, maximum: maximumBytes)
}
- /// Whether a removal could be recorded in History at `url` now: the folder it is written into can be written, its
- /// disk has room for the copy a safe write makes of the whole file, with a megabyte to spare, and the journal
- /// beside it can take what moves meanwhile.
- public static func canBeWritten(
+ /// Why a removal couldn't be recorded in History at `url` now, or nil when it could: the folder it is written
+ /// into can be written, its disk has room for the copy a safe write makes of the whole file, with a megabyte to
+ /// spare, and the journal beside it can take what moves meanwhile.
+ public static func writeProblem(
at url: URL = RemovalHistory.defaultURL,
freeSpace: (URL) -> UInt64? = RemovalLog.freeSpace(at:)
- ) -> Bool {
+ ) -> HistoryWriteProblem? {
var folder = url.deletingLastPathComponent()
while folder.isMissing, folder.path(percentEncoded: false) != "/" { folder = folder.deletingLastPathComponent() }
- guard access(folder.path(percentEncoded: false), W_OK) == 0, let free = freeSpace(folder) else { return false }
+ guard access(folder.path(percentEncoded: false), W_OK) == 0 else { return .folderNotWritable(folder) }
+ guard let free = freeSpace(folder) else { return .freeSpaceNotKnown(folder) }
let size = (try? url.resourceValues(forKeys: [.fileSizeKey]).fileSize).map { UInt64($0) } ?? 0
- return free >= size + 1_000_000 && RemovalJournal(beside: url).canBeWritten
+ let needed = size + 1_000_000
+ guard free >= needed else { return .diskFull(free: Int64(clamping: free), needed: Int64(clamping: needed)) }
+ return RemovalJournal(beside: url).writeProblem
}
/// The space free on the disk holding `folder`, as `statfs(2)` gives it.
@@ -200,9 +216,7 @@ public actor RemovalLog {
/// lines go. An item History already has is not recorded again: a process may have stopped after writing
/// History and before letting its lines go.
private func takingInInterrupted(_ records: [RemovalRecord]) -> [RemovalRecord] {
- if let setAside = journal.setAsideIfUnreadable() {
- note(.damaged(setAside: setAside))
- }
+ keepAsideAnUnreadableJournal()
let left = journal.left()
guard !left.isEmpty else { return records }
let recorded = Set(records.map { RemovalJournal.Key($0.trashedItem) })
diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/TrashService.swift b/Packages/PeelCore/Sources/PeelCore/Removal/TrashService.swift
index 5156e5a0..17467436 100644
--- a/Packages/PeelCore/Sources/PeelCore/Removal/TrashService.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Removal/TrashService.swift
@@ -97,8 +97,9 @@ public struct TrashFailure: Sendable, Hashable {
case somethingElseMoved(named: String)
/// History cannot be read, so nothing moves: what moved could not be listed for Put Back.
case historyUnreadable
- /// History cannot be written, as on a full disk, so nothing moves: what moved could not be listed for Put Back.
- case historyCannotBeWritten
+ /// History cannot be written, for the reason it names, so nothing moves: what moved could not be listed for Put
+ /// Back. Nil for a refusal recorded before Peel kept the reason.
+ case historyCannotBeWritten(HistoryWriteProblem?)
/// Peel is removing itself, History and its folder with it, so nothing else moves meanwhile.
case peelRemovesItself
/// These processes hold a file open in it, and moving it would pull it from under them.
@@ -190,6 +191,7 @@ extension TrashFailure.Reason {
case .guarded(let refusal): refusal?.detail
case .failed(let message): message
case .somethingElseMoved(let name): name
+ case .historyCannotBeWritten(let problem): problem?.detail
case .heldOpen(let processes), .heldOpenByAJob(let processes), .heldByAnotherAccount(let processes),
.openForAnotherUser(let processes),
.heldByABuildTool(let processes), .inUseByMacOS(let processes):
@@ -216,7 +218,7 @@ extension TrashFailure.Reason {
case "moved-without-a-trace": self = .movedWithoutATrace
case "something-else-moved": self = .somethingElseMoved(named: detail ?? "")
case "history-unreadable": self = .historyUnreadable
- case "history-cannot-be-written": self = .historyCannotBeWritten
+ case "history-cannot-be-written": self = .historyCannotBeWritten(detail.flatMap(HistoryWriteProblem.init(detail:)))
case "peel-removes-itself": self = .peelRemovesItself
case "held-open": self = .heldOpen(by: (detail ?? "").split(separator: "\n").map(String.init))
case "held-open-by-a-job": self = .heldOpenByAJob(by: (detail ?? "").split(separator: "\n").map(String.init))
@@ -477,7 +479,7 @@ public struct TrashService: Sendable {
private var historyRefusal: TrashFailure.Reason? {
guard let journal else { return nil }
if !journal.historyCanBeRead { return .historyUnreadable }
- return journal.historyCanBeWritten ? nil : .historyCannotBeWritten
+ return journal.historyWriteProblem.map(TrashFailure.Reason.historyCannotBeWritten)
}
/// Every item of `urls` refused, while History can't be read or written. An item the guard refuses keeps that
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/RefusalLogTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/RefusalLogTests.swift
index 73ebe03a..f69cbf70 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/RefusalLogTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/RefusalLogTests.swift
@@ -367,7 +367,8 @@ struct RefusalLogTests {
private static let everyReason: [TrashFailure.Reason] = [
.guarded(nil), .changedSinceScan, .changeNotKnown, .claimedSinceScan, .lastCopy, .notPermitted, .locked,
.needsHelper,
- .movedWithoutATrace, .somethingElseMoved(named: "x 2"), .historyUnreadable, .historyCannotBeWritten,
+ .movedWithoutATrace, .somethingElseMoved(named: "x 2"), .historyUnreadable,
+ .historyCannotBeWritten(.folderNotWritable(URL(filePath: "/Users/me/Library/Application Support/Peel/"))),
.peelRemovesItself, .heldOpen(by: ["Figma Agent", "java"]), .heldOpenByAJob(by: ["Figma Agent", "java"]), .peelRunsFromIt,
.heldByAnotherAccount(by: ["CtxHelper"]), .openForAnotherUser(by: ["Spotify"]), .heldByABuildTool(by: ["Gradle"]),
.inUseAsAnInputSource, .inUseByMacOS(by: ["geod", "appleaccountd"]), .attachedDiskImage, .failed("x"),
@@ -379,7 +380,7 @@ struct RefusalLogTests {
#expect(Set(reasons.map(\.name)).count == reasons.count)
#expect(reasons.allSatisfy { !$0.name.contains(" ") })
- #expect(reasons.filter { $0.detail != nil }.count == 8)
+ #expect(reasons.filter { $0.detail != nil }.count == 9)
}
/// History words a refusal from the reason it stored, so every word leads back to its reason, and a word a
@@ -396,6 +397,20 @@ struct RefusalLogTests {
#expect(TrashFailure.Reason(name: "protected-location", detail: nil) == .guarded(nil))
}
+ @Test func whyHistoryCouldNotBeWrittenReadsBack() {
+ let peel = URL(filePath: "/Users/me/Library/Application Support/Peel/")
+ let journal = peel.appending(path: "removals.journal")
+ let problems: [HistoryWriteProblem] = [
+ .folderNotWritable(peel), .diskFull(free: 1_000, needed: 1_000_002), .freeSpaceNotKnown(peel),
+ .journalUnreadable(journal), .journalNotWritable(journal),
+ ]
+ for problem in problems {
+ let reason = TrashFailure.Reason.historyCannotBeWritten(problem)
+ #expect(TrashFailure.Reason(name: reason.name, detail: reason.detail) == reason)
+ }
+ #expect(TrashFailure.Reason(name: "history-cannot-be-written", detail: nil) == .historyCannotBeWritten(nil))
+ }
+
/// What one removal refused shares a batch and its source, so History shows it as one entry, in the words of
/// the source Peel named.
@Test func oneRemovalsRefusalsShareABatch() async throws {
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/RemovalJournalTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/RemovalJournalTests.swift
index 1fd28b8b..063844f9 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/RemovalJournalTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/RemovalJournalTests.swift
@@ -172,8 +172,8 @@ struct RemovalJournalTests {
let journal = RemovalJournal(beside: history)
try FileManager.default.createDirectory(at: journal.url, withIntermediateDirectories: true)
- #expect(!RemovalLog.canBeWritten(at: history))
- #expect(!journal.historyCanBeWritten)
+ #expect(RemovalLog.writeProblem(at: history) == .journalUnreadable(journal.url))
+ #expect(journal.historyWriteProblem == .journalUnreadable(journal.url))
}
@Test func aJournalThatCannotBeReadIsKeptAsideAndSaid() async throws {
@@ -190,7 +190,35 @@ struct RemovalJournalTests {
}
#expect(aside.isThere)
#expect(journal.url.isMissing)
- #expect(RemovalLog.canBeWritten(at: history))
+ #expect(RemovalLog.writeProblem(at: history) == nil)
+ }
+
+ @Test func aJournalThatCannotBeReadIsKeptAsideWithoutReadingHistory() async throws {
+ let directory = try TemporaryDirectory()
+ let history = try directory.file("Peel/removals.json", contents: Data("[]".utf8))
+ let journal = RemovalJournal(beside: history)
+ try FileManager.default.createDirectory(at: journal.url, withIntermediateDirectories: true)
+
+ let problem = await RemovalLog(url: history).setAsideAnUnreadableJournal()
+
+ guard case .damaged(let aside) = problem else {
+ Issue.record("nothing said: \(String(describing: problem))")
+ return
+ }
+ #expect(aside.isThere)
+ #expect(journal.url.isMissing)
+ #expect(RemovalLog.writeProblem(at: history) == nil)
+ }
+
+ @Test(.permissionsHold) func aJournalThisAccountCannotWriteIsNamed() throws {
+ let directory = try TemporaryDirectory()
+ let history = try directory.file("Peel/removals.json", contents: Data("[]".utf8))
+ let journal = RemovalJournal(beside: history)
+ _ = try directory.file("Peel/removals.journal", contents: Data())
+ try directory.setPermissions(0o444, of: "Peel/removals.journal")
+ defer { try? directory.setPermissions(0o644, of: "Peel/removals.journal") }
+
+ #expect(RemovalLog.writeProblem(at: history) == .journalNotWritable(journal.url))
}
@Test func anItemPutBackLeavesTheJournal() async throws {
@@ -370,20 +398,25 @@ struct RemovalJournalTests {
return directory.url.appending(path: "home/.Trash/\(url.lastPathComponent)")
}
- #expect(service.refusalOfEveryMove == .historyCannotBeWritten)
+ let folder = history.deletingLastPathComponent()
+ let refusal = TrashFailure.Reason.historyCannotBeWritten(.folderNotWritable(folder))
+ #expect(service.refusalOfEveryMove == refusal)
let result = await service.trash([item])
#expect(moved.withLock { $0 }.isEmpty)
- #expect(result.failures.map(\.reason) == [.historyCannotBeWritten])
+ #expect(result.failures.map(\.reason) == [refusal])
}
@Test func historyNeedsRoomForTheCopyItsWriteMakes() throws {
let directory = try TemporaryDirectory()
let history = try directory.file("Peel/removals.json", contents: Data("[]".utf8))
- #expect(RemovalLog.canBeWritten(at: history))
- #expect(RemovalLog.canBeWritten(at: directory.url.appending(path: "Missing/Peel/removals.json")))
- #expect(!RemovalLog.canBeWritten(at: history, freeSpace: { _ in 1_000 }))
+ #expect(RemovalLog.writeProblem(at: history) == nil)
+ #expect(RemovalLog.writeProblem(at: directory.url.appending(path: "Missing/Peel/removals.json")) == nil)
+ let full = HistoryWriteProblem.diskFull(free: 1_000, needed: 1_000_002)
+ #expect(RemovalLog.writeProblem(at: history, freeSpace: { _ in 1_000 }) == full)
+ let folder = history.deletingLastPathComponent()
+ #expect(RemovalLog.writeProblem(at: history, freeSpace: { _ in nil }) == .freeSpaceNotKnown(folder))
}
/// Peel's folder holds the journal, and Peel moves it last as it removes itself: that move is not written
diff --git a/Peel/Model/RemovalHistoryStore.swift b/Peel/Model/RemovalHistoryStore.swift
index 8ab03bf9..f5db3da3 100644
--- a/Peel/Model/RemovalHistoryStore.swift
+++ b/Peel/Model/RemovalHistoryStore.swift
@@ -170,8 +170,8 @@ final class RemovalHistoryStore {
/// Whether History cannot be read, which holds every removal back, as the Trash service does. Known without
/// reading it: at launch, when Peel comes forward, and with every read or change of History.
private(set) var isUnreadable = false
- /// Whether History cannot be written, as on a full disk, which holds every removal back too. Known the same way.
- private(set) var cannotBeWritten = false
+ /// Why History cannot be written, as on a full disk, which holds every removal back too. Known the same way.
+ private(set) var writeProblem: HistoryWriteProblem?
private(set) var isRestoring = false
var selection: RemovalBatch.ID?
/// By record, not by path: Space and Developer move the same cache folders again and again, so one path
@@ -289,12 +289,15 @@ final class RemovalHistoryStore {
defaults.set(count, forKey: SettingsKey.toldNoLongerListed)
}
- /// Looks again at whether History can be read and written, which costs no read of it.
- func checkReadability() {
+ /// Looks again at whether History can be read and written, which costs no read of it. A journal that can't be read
+ /// is kept aside first, as a read of History keeps it, so it holds nothing back.
+ func checkReadability() async {
+ let problem = await log.setAsideAnUnreadableJournal()
+ if self.problem != problem { self.problem = problem }
let unreadable = !RemovalLog.canBeRead(at: log.url)
- let unwritable = !unreadable && !RemovalLog.canBeWritten(at: log.url)
+ let writeProblem = unreadable ? nil : RemovalLog.writeProblem(at: log.url)
if isUnreadable != unreadable { isUnreadable = unreadable }
- if cannotBeWritten != unwritable { cannotBeWritten = unwritable }
+ if self.writeProblem != writeProblem { self.writeProblem = writeProblem }
}
/// Keeps a History that cannot be read beside a new one, and records again.
@@ -400,7 +403,7 @@ final class RemovalHistoryStore {
if !result.failures.isEmpty {
await loadRefusals()
}
- checkReadability()
+ await checkReadability()
}
/// Tells what `removal` moved once every part of it is recorded: the bar's "Moved", VoiceOver, the lifetime
@@ -431,7 +434,7 @@ final class RemovalHistoryStore {
if removesPeel() { return .peelRemovesItself }
guard knowsTheExclusions() else { return .guarded(.exclusionsNotKnown) }
if isUnreadable { return .historyUnreadable }
- return cannotBeWritten ? .historyCannotBeWritten : nil
+ return writeProblem.map(TrashFailure.Reason.historyCannotBeWritten)
}
var mayMove: Bool { holdingReason == nil }
@@ -464,7 +467,7 @@ final class RemovalHistoryStore {
/// records listed already.
private func apply(_ outcome: RemovalLogOutcome) async {
problem = outcome.problem
- checkReadability()
+ await checkReadability()
if noLongerListed != outcome.noLongerListed {
if toldNoLongerListed == nil {
toldNoLongerListed = defaults.integer(forKey: SettingsKey.toldNoLongerListed)
diff --git a/Peel/PeelApp.swift b/Peel/PeelApp.swift
index 1391d4db..f97fa86d 100644
--- a/Peel/PeelApp.swift
+++ b/Peel/PeelApp.swift
@@ -222,7 +222,7 @@ struct PeelApp: App {
// `peel exclusions` may have changed the list while another app was in front.
Task { await exclusions.load() }
// History may have become readable again meanwhile, or stopped being, and `peel` may have moved something.
- history.checkReadability()
+ Task { await history.checkReadability() }
stats.reload()
Task { await history.readAgainIfInUse() }
homebrew.checkInstalled()
@@ -346,7 +346,7 @@ struct PeelApp: App {
/// Loads what every page needs once, at launch: the exclusions, the apps, Homebrew, and Home's checks.
private func launch() async {
history.stats = stats
- history.checkReadability()
+ await history.checkReadability()
// On the main actor, so it never runs between the SSH tab's own read and write.
SSHFile.bringUpToDate(ssh.file)
Task { await stats.takeInEarlierTotals() }
diff --git a/Peel/Views/Home/HomePermissionsView.swift b/Peel/Views/Home/HomePermissionsView.swift
index f72fcbdc..65807d2e 100644
--- a/Peel/Views/Home/HomePermissionsView.swift
+++ b/Peel/Views/Home/HomePermissionsView.swift
@@ -243,12 +243,8 @@ struct HomePermissionsContent: View {
Button("Open History") { Navigator.shared.requestedTool = .history }
.buttonStyle(.sticker(fill: Album.redFill, size: 11.5))
}
- } else if held == .historyUnwritable {
- Notice(
- title: Text("Peel can’t write History"),
- detail: Text("The disk is full, or Peel’s folder can’t be written. Peel removes nothing until it can, so that everything it moves can be put back."),
- isAlbum: true
- ) {}
+ } else if case .historyUnwritable(let problem) = held {
+ Notice(title: Text("Peel can’t write History"), detail: Text(problem.explanation()), isAlbum: true) {}
} else if home.needsAttention {
let notice = MissingPermissionsNotice(
helper: helper.standing,
diff --git a/Peel/Views/Presentation.swift b/Peel/Views/Presentation.swift
index da68cc95..c06103e1 100644
--- a/Peel/Views/Presentation.swift
+++ b/Peel/Views/Presentation.swift
@@ -205,7 +205,8 @@ extension TrashFailure.Reason {
case .movedWithoutATrace: String(localized: "It is in the Trash, but macOS didn’t say where, so it can only be put back from Finder.", bundle: bundle)
case .somethingElseMoved(let name): String(localized: "Something else was at that path by the time it moved. It is in the Trash as \(name), and Finder can put it back.", bundle: bundle)
case .historyUnreadable: String(localized: "Peel couldn’t read History, and it moves nothing it can’t put back.", bundle: bundle)
- case .historyCannotBeWritten: String(localized: "Peel couldn’t write to History, because the disk is full or Peel’s folder can’t be written, and it moves nothing it can’t put back.", bundle: bundle)
+ case .historyCannotBeWritten(let problem?): problem.explanation(in: bundle)
+ case .historyCannotBeWritten(nil): String(localized: "Peel couldn’t write to History then, and it moves nothing it can’t put back.", bundle: bundle)
case .peelRemovesItself: String(localized: "Peel is removing itself, so it moves nothing else meanwhile.", bundle: bundle)
case .heldOpen(let processes):
String(localized: "It is in use by \(processes.formatted(.list(type: .and))). Quit \(processes.formatted(.list(type: .and))), then try again.", bundle: bundle)
@@ -235,6 +236,25 @@ extension TrashFailure.Reason {
}
}
+extension HistoryWriteProblem {
+ /// What keeps History from being written, and that nothing moves meanwhile, read from `bundle`, or from the main
+ /// bundle when it is nil.
+ func explanation(in bundle: Bundle? = nil) -> String {
+ switch self {
+ case .folderNotWritable(let folder):
+ String(localized: "This account can’t write to \(folder.abbreviatedPath), where Peel keeps History. Peel removes nothing until it can, so that everything it moves can be put back.", bundle: bundle)
+ case .diskFull(let free, let needed):
+ String(localized: "The disk that holds Peel’s folder has \(free.formatted(.byteCount(style: .file))) free, and writing History needs \(needed.formatted(.byteCount(style: .file))). Peel removes nothing until there is room, so that everything it moves can be put back.", bundle: bundle)
+ case .freeSpaceNotKnown(let folder):
+ String(localized: "macOS didn’t say how much room is free on the disk that holds \(folder.abbreviatedPath). Peel removes nothing until it knows, so that everything it moves can be put back.", bundle: bundle)
+ case .journalUnreadable(let journal):
+ String(localized: "Something Peel can’t use stands at \(journal.abbreviatedPath), where it writes down each move, and Peel couldn’t set it aside. Peel removes nothing until it’s gone, so that everything it moves can be put back.", bundle: bundle)
+ case .journalNotWritable(let journal):
+ String(localized: "This account can’t write \(journal.abbreviatedPath), where Peel writes down each move. Peel removes nothing until it can, so that everything it moves can be put back.", bundle: bundle)
+ }
+ }
+}
+
extension PrivacyReset.Result {
/// Why the app's privacy permissions were not reset, or nil when they were.
var explanation: String? {
diff --git a/Peel/Views/RemovalsHeldBanner.swift b/Peel/Views/RemovalsHeldBanner.swift
index ef6d7b04..75d57e88 100644
--- a/Peel/Views/RemovalsHeldBanner.swift
+++ b/Peel/Views/RemovalsHeldBanner.swift
@@ -6,15 +6,16 @@ import SwiftUI
enum MovesHeld: Equatable {
case exclusionsUnreadable
case historyUnreadable
- case historyUnwritable
+ case historyUnwritable(HistoryWriteProblem)
static func reason(
- exclusionsUnreadable: Bool, historyUnreadable: Bool, historyUnwritable: Bool, recordsInHistory: Bool = true
+ exclusionsUnreadable: Bool, historyUnreadable: Bool, historyUnwritable: HistoryWriteProblem?,
+ recordsInHistory: Bool = true
) -> MovesHeld? {
if exclusionsUnreadable { return .exclusionsUnreadable }
guard recordsInHistory else { return nil }
if historyUnreadable { return .historyUnreadable }
- return historyUnwritable ? .historyUnwritable : nil
+ return historyUnwritable.map(MovesHeld.historyUnwritable)
}
@MainActor
@@ -23,7 +24,7 @@ enum MovesHeld: Equatable {
) -> MovesHeld? {
reason(
exclusionsUnreadable: exclusions.exclusions.isUnreadable, historyUnreadable: history.isUnreadable,
- historyUnwritable: history.cannotBeWritten, recordsInHistory: recordsInHistory
+ historyUnwritable: history.writeProblem, recordsInHistory: recordsInHistory
)
}
}
@@ -61,11 +62,8 @@ struct RemovalsHeldBanner: View {
}
.padding(.vertical, 6)
.listRowSeparator(.hidden)
- } else if held == .historyUnwritable {
- Notice(
- title: Text("Peel can’t write History"),
- detail: Text("The disk is full, or Peel’s folder can’t be written. Peel removes nothing until it can, so that everything it moves can be put back.")
- ) {}
+ } else if case .historyUnwritable(let problem) = held {
+ Notice(title: Text("Peel can’t write History"), detail: Text(problem.explanation())) {}
.padding(.vertical, 6)
.listRowSeparator(.hidden)
}
diff --git a/Peel/Views/Settings/SettingsView.swift b/Peel/Views/Settings/SettingsView.swift
index ffb65df3..6029faac 100644
--- a/Peel/Views/Settings/SettingsView.swift
+++ b/Peel/Views/Settings/SettingsView.swift
@@ -453,8 +453,8 @@ private struct GeneralSettingsView: View {
Text("Peel removes nothing until you start History over, so that everything it moves can be put back.")
.font(.callout)
.foregroundStyle(.secondary)
- } else if history.cannotBeWritten {
- Text("The disk is full, or Peel’s folder can’t be written. Peel removes nothing until it can, so that everything it moves can be put back.")
+ } else if let problem = history.writeProblem {
+ Text(problem.explanation())
.font(.callout)
.foregroundStyle(.secondary)
} else if let block = Self.blockAhead {
diff --git a/PeelTests/MovesHeldTests.swift b/PeelTests/MovesHeldTests.swift
index 1e62614b..5886e48c 100644
--- a/PeelTests/MovesHeldTests.swift
+++ b/PeelTests/MovesHeldTests.swift
@@ -1,23 +1,30 @@
+import Foundation
@testable import Peel
+import PeelCore
import Testing
struct MovesHeldTests {
+ private static let full = HistoryWriteProblem.diskFull(free: 1_000, needed: 1_000_002)
+
@Test func namesWhatKeepsEveryMoveBack() {
func reason(_ exclusions: Bool, _ history: Bool, _ writing: Bool) -> MovesHeld? {
- MovesHeld.reason(exclusionsUnreadable: exclusions, historyUnreadable: history, historyUnwritable: writing)
+ MovesHeld.reason(
+ exclusionsUnreadable: exclusions, historyUnreadable: history,
+ historyUnwritable: writing ? Self.full : nil
+ )
}
#expect(reason(false, false, false) == nil)
#expect(reason(true, true, true) == .exclusionsUnreadable)
#expect(reason(false, true, true) == .historyUnreadable)
- #expect(reason(false, false, true) == .historyUnwritable)
+ #expect(reason(false, false, true) == .historyUnwritable(Self.full))
}
@Test func anActionHistoryDoesntRecordWaitsOnlyForTheExclusions() {
func reason(_ exclusions: Bool, _ history: Bool, _ writing: Bool) -> MovesHeld? {
MovesHeld.reason(
- exclusionsUnreadable: exclusions, historyUnreadable: history, historyUnwritable: writing,
- recordsInHistory: false
+ exclusionsUnreadable: exclusions, historyUnreadable: history,
+ historyUnwritable: writing ? Self.full : nil, recordsInHistory: false
)
}
diff --git a/PeelTests/RemovalBarTests.swift b/PeelTests/RemovalBarTests.swift
index 7f8c43bb..9afb7384 100644
--- a/PeelTests/RemovalBarTests.swift
+++ b/PeelTests/RemovalBarTests.swift
@@ -40,7 +40,7 @@ struct RemovalBarTests {
#expect(RemovalBar.tooMany(in: parts(3)) == nil)
}
- @Test func anActionHistoryDoesntRecordWaitsOnlyForTheExclusions() throws {
+ @Test func anActionHistoryDoesntRecordWaitsOnlyForTheExclusions() async throws {
let folder = FileManager.default.temporaryDirectory.appending(path: "PeelTests-\(UUID().uuidString)")
let unreadable = folder.appending(path: "removals.json")
try FileManager.default.createDirectory(at: unreadable, withIntermediateDirectories: true)
@@ -49,7 +49,7 @@ struct RemovalBarTests {
log: RemovalLog(url: unreadable), refusals: RefusalLog(url: folder.appending(path: "refusals.json")),
knowsTheExclusions: { true }
)
- history.checkReadability()
+ await history.checkReadability()
#expect(history.isUnreadable)
#expect(RemovalBar.mayAct(recordsInHistory: false, history: history, exclusionsAreKnown: true))
diff --git a/PeelTests/RemovalHistoryStoreTests.swift b/PeelTests/RemovalHistoryStoreTests.swift
index 7fc06b38..8a9d6e2a 100644
--- a/PeelTests/RemovalHistoryStoreTests.swift
+++ b/PeelTests/RemovalHistoryStoreTests.swift
@@ -43,6 +43,28 @@ struct RemovalHistoryStoreTests {
#expect(history.undoTitle == nil, "Undo still offered what peel put back")
}
+ @Test func aJournalThatCannotBeReadHoldsNothingBackOnceChecked() async throws {
+ let folder = FileManager.default.temporaryDirectory.appending(path: "PeelTests-\(UUID().uuidString)")
+ defer { try? FileManager.default.removeItem(at: folder) }
+ try FileManager.default.createDirectory(
+ at: folder.appending(path: "removals.journal"), withIntermediateDirectories: true
+ )
+ let history = RemovalHistoryStore(
+ log: RemovalLog(url: folder.appending(path: "removals.json")),
+ refusals: RefusalLog(url: folder.appending(path: "refusals.json")),
+ knowsTheExclusions: { true }
+ )
+
+ await history.checkReadability()
+
+ #expect(history.writeProblem == nil)
+ #expect(history.mayMove)
+ guard case .damaged = history.problem else {
+ Issue.record("nothing said: \(String(describing: history.problem))")
+ return
+ }
+ }
+
@Test func saysOnceWhatHistoryNoLongerLists() async throws {
let folder = FileManager.default.temporaryDirectory.appending(path: "PeelTests-\(UUID().uuidString)")
defer { try? FileManager.default.removeItem(at: folder) }