Please use System.IO.Compression! A fork of the DotNetZip project without signing with a solution that compiles cleanly. This project aims to follow semver to avoid versioning conflicts. DotNetZip is a FAST, FREE class library and toolset for manipulating zip files. Use VB, C# or any .NET language to easily create, extract, or update zip files.
Hi,
First of, thank you very much for your sharing and maintaining this excellent library!
There is an unhandled exception in SharedUtilities.GetFileLength() when calling ZipFile.Save() and it contains a file that you dont have access to.
I dont know how you want it to work but maybe this exception should be caught, a ZipError event is triggered and the save operation continuous without the file?
Maybe the current way of determining file size was chosen for a reason but there is an alternate way:
return new FileInfo(fileName).Length;
A little background information. I am using the library in a backup application. Some files scheduled for backup may locked be another application, in this case the backup should still be completed but without the files that cannot be accessed.
Best regards
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Ionic.Zip.SharedUtilities.GetFileLength(String fileName) in DotNetZip-master\Zip\Shared.cs:line 54
at Ionic.Zip.ZipEntry.MaybeUnsetCompressionMethodForWriting(Int32 cycle) in DotNetZip-master\Zip\ZipEntry.Write.cs:line 741
at Ionic.Zip.ZipEntry.WriteHeader(Stream s, Int32 cycle) in DotNetZip-master\Zip\ZipEntry.Write.cs:line 1026
at Ionic.Zip.ZipEntry.Write(Stream s) in DotNetZip-master\Zip\ZipEntry.Write.cs:line 2214
at Ionic.Zip.ZipFile.Save() in DotNetZip-master\Zip\ZipFile.Save.cs:line 169
Hi, First of, thank you very much for your sharing and maintaining this excellent library!
There is an unhandled exception in SharedUtilities.GetFileLength() when calling ZipFile.Save() and it contains a file that you dont have access to.
I dont know how you want it to work but maybe this exception should be caught, a ZipError event is triggered and the save operation continuous without the file?
Maybe the current way of determining file size was chosen for a reason but there is an alternate way: return new FileInfo(fileName).Length;
A little background information. I am using the library in a backup application. Some files scheduled for backup may locked be another application, in this case the backup should still be completed but without the files that cannot be accessed.
Best regards
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at Ionic.Zip.SharedUtilities.GetFileLength(String fileName) in DotNetZip-master\Zip\Shared.cs:line 54 at Ionic.Zip.ZipEntry.MaybeUnsetCompressionMethodForWriting(Int32 cycle) in DotNetZip-master\Zip\ZipEntry.Write.cs:line 741 at Ionic.Zip.ZipEntry.WriteHeader(Stream s, Int32 cycle) in DotNetZip-master\Zip\ZipEntry.Write.cs:line 1026 at Ionic.Zip.ZipEntry.Write(Stream s) in DotNetZip-master\Zip\ZipEntry.Write.cs:line 2214 at Ionic.Zip.ZipFile.Save() in DotNetZip-master\Zip\ZipFile.Save.cs:line 169