icsharpcode / SharpZipLib

#ziplib is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform.
http://icsharpcode.github.io/SharpZipLib/
MIT License
3.7k stars 976 forks source link

Problem when create zip in network folder #861

Open viettieubao opened 4 months ago

viettieubao commented 4 months ago

Describe the bug

I use this function "CreateZip(string zipFileName, string sourceDirectory, bool recurse, string fileFilter, string directoryFilter)" to create the zip in a network folder. Sometimes I receive the error "Exception: System.IO.FileNotFoundException: Unable to find the specified file." I guess that some problem occurs when do "File.Create(zipFileName)". Maybe the impact come from the connection with network folder.

Reproduction Code

No response

Steps to reproduce

It's very hard to reproduce, But I think we can do a cheat to reproduce. when the zip file was created by File.Create(zipFileName), delete this file and continue

Expected behavior

My idea is have a check to ensure that the zipfile must be created before send to the next function or throw a correct log.

Operating System

Windows

Framework Version

.NET Framework 4.x

Tags

ZIP

Additional context

I use version 1.4.2