`WriteEntry(TarEntry, bool)` writes the entry without bytes if the file is used by another process
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Inizia in src/ICSharpCode.SharpZipLib/Tar/TarArchive.cs alle righe collegate intorno a WriteEntry(TarEntry, bool), soprattutto nel punto in cui viene aggiunta la voce e nel punto in cui la lettura del file genera una IOException. Segui il percorso con cui una lettura fallita arriva alla chiusura dell'archivio e verifica i test esistenti relativi a Tar. Il lavoro è completato quando un file bloccato produce un errore contestuale chiaro senza lasciare una voce pendente che causi in seguito una TarException.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
This issue makes it inconvenient to use SharpZipLib, because disposing the tar archive will throw a TarException that hides the underlying issue. When a file is used by another process, WriteEntry(TarEntry, bool) writes the entry, but obviously not the bytes (which is fine). Due to the dangling tar entry, disposing (leaving the using block) the tar archive throws:
Entry closed at '0' before the 'x' bytes specified in the header were written.
It is not clear which file is responsible for the error. Following line throws an IOException:
if a file is used by another process, but a few lines before, the entry is already added:
Reproduction Code
No response
Steps to reproduce
-
Expected behavior
WriteEntry(TarEntry, bool) fails with a clear error message that considers the context.
Operating System
Windows, macOS, Linux
Framework Version
.NET 7, .NET 6
Tags
Tar
Additional context
As workaround I check in advance if the process can read the file.
- Lingua principale
- C#
- Stelle
- 3.9k
- Fork
- 1k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di icsharpcode/SharpZipLib
-
*no response* bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
icsharpcode/SharpZipLib#905 · 1 commento ·
-
bug bzip2
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
icsharpcode/SharpZipLib#904 ·
-
SetLevel in ZipFile Apertaenhancement zip
Difficoltà 2/5 1-2 giorni Idoneità per principianti 55/100
icsharpcode/SharpZipLib#903 ·
-
*no response* bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 32/100
icsharpcode/SharpZipLib#901 · 1 commento ·
-
*no response* bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
icsharpcode/SharpZipLib#894 · 1 commento ·
Tutte le issue di icsharpcode/SharpZipLib
Issue simili
-
bug needs response
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Adyen/adyen-dotnet-api-library#1869 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
difficulty/starter 🚀 good first issue kind/bug platform/ios 🍎 project/non-ui ⚙️ triage/untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
unoplatform/uno#24650 ·
-
area-ai untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
dotnet/extensions#7783 ·
-
untriaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
dotnet/dotnet-api-docs#13095 ·