`WriteEntry(TarEntry, bool)` writes the entry without bytes if the file is used by another process
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Comienza en src/ICSharpCode.SharpZipLib/Tar/TarArchive.cs en las líneas enlazadas alrededor de WriteEntry(TarEntry, bool), especialmente donde se añade la entrada y donde la lectura del archivo produce una IOException. Sigue cómo una lectura fallida llega a la eliminación del archivo y revisa las pruebas existentes relacionadas con Tar. Se considera terminado cuando un archivo bloqueado produce un error contextual claro sin dejar una entrada huérfana que provoque posteriormente una TarException.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C#
- Estrellas
- 3.9k
- Forks
- 1k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de icsharpcode/SharpZipLib
-
*no response* bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
icsharpcode/SharpZipLib#905 · 1 comentario ·
-
bug bzip2
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
icsharpcode/SharpZipLib#904 ·
-
SetLevel in ZipFile Abiertoenhancement zip
Dificultad 2/5 1-2 días Aptitud para principiantes 55/100
icsharpcode/SharpZipLib#903 ·
-
*no response* bug
Dificultad 4/5 3-5 días Aptitud para principiantes 32/100
icsharpcode/SharpZipLib#901 · 1 comentario ·
-
*no response* bug
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
icsharpcode/SharpZipLib#894 · 1 comentario ·
Todos los issues de icsharpcode/SharpZipLib
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
bug needs response
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Adyen/adyen-dotnet-api-library#1869 ·
-
Status: Needs Triage Type: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
bug effort:S P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
nightscout/nocturne#1602 ·