Opening 7zip archive with invalid win32 date #171

Closed
opened 2026-01-29 22:07:45 +00:00 by claunia · 2 comments
Owner

Originally created by @Thritton on GitHub (Apr 28, 2017).

Hello,
Sharpcompress library is very good, thank you for it.

I have a problem with opening 7z achives where one of file has invalid modified date (e.g. 27.2.27586) (These archives are generated automatically from other system I cannot access).
When such file is in 7zip archive, ArgumentOutOfRangeException is thrown during getting entries. and file cannot be processed further:

using (var archive = ArchiveFactory.Open(f))
{ 
var files = archive.Entries.Select(x => x.Key).ToList();
}

An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
Additional information: Not a valid Win32 FileTime.

Zip archives with such file work ok (date is ignored).
Is it possible to ignore invalid dates in 7z archive as well?

Thank you

Originally created by @Thritton on GitHub (Apr 28, 2017). Hello, Sharpcompress library is very good, thank you for it. I have a problem with opening 7z achives where one of file has invalid modified date (e.g. 27.2.27586) (These archives are generated automatically from other system I cannot access). When such file is in 7zip archive, ArgumentOutOfRangeException is thrown during getting entries. and file cannot be processed further: ``` using (var archive = ArchiveFactory.Open(f)) { var files = archive.Entries.Select(x => x.Key).ToList(); } An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll Additional information: Not a valid Win32 FileTime. ``` Zip archives with such file work ok (date is ignored). Is it possible to ignore invalid dates in 7z archive as well? Thank you
claunia added the bug label 2026-01-29 22:07:45 +00:00
Author
Owner

@adamhathcock commented on GitHub (Apr 28, 2017):

I would accept a pull request for this.

@adamhathcock commented on GitHub (Apr 28, 2017): I would accept a pull request for this.
Author
Owner

@adamhathcock commented on GitHub (Sep 19, 2017):

Fixed by https://github.com/adamhathcock/sharpcompress/pull/303

@adamhathcock commented on GitHub (Sep 19, 2017): Fixed by https://github.com/adamhathcock/sharpcompress/pull/303
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#171