Comments (7)
Actually, now that I look more closely, the date modified for the problem file is originally 1980-01-01 07:00 (in the original EPUB). But the date modified of the unpacked file, the one that zipstorer is later crashing on when it tries to save it, is 31/12/2107 11:00 PM.
So now I see that the problem might be being caused by the open process, which would mean DosTimeToDateTime is not handling the original date modified.
from zipstorer.
For an example, see the "mimetype" file in the following:
Lewis - 4. The Silver Chair.zip
from zipstorer.
Hi, I see 2107 in all messages, rather than 2017.
is this a typo?
from zipstorer.
No it's not a typo. As far as I can tell, the open process takes the original file date 1980-01-01 07:00 and gives the unpacked file a date of 31/12/2107 11:00 PM. Then when my program later tries to save the zip file, zipstorer crashes.
from zipstorer.
I have implemented a work-around. The function DosTimeToDateTime in the zipstorer.vb now looks like this:
Private Function DosTimeToDateTime(ByVal _dt As UInteger) As DateTime
Dim year As Integer = CType(_dt >> 25, Integer) + 1980
Dim month As Integer = CType(_dt >> 21, Integer) And 15
Dim day As Integer = CType(_dt >> 16, Integer) And 31
Dim hours As Integer = CType(_dt >> 11, Integer) And 31
Dim minutes As Integer = CType(_dt >> 5, Integer) And 63
Dim seconds As Integer = CType(_dt And 31, Integer) * 2
If ((year >= 2107) Or (month = 0) Or (day = 0)) Then Return DateTime.Now
Return New DateTime(year, month, day, hours, minutes, seconds)
End Function
It's a bit of a fudge, but at least it prevents the exception error!
from zipstorer.
Solved by reading the NTFS FileTime extra info.
from zipstorer.
Thanks for this.
I've incorporated your changes into my program, converting them into vb.net in the process, and will do some testing. But initial tests look good!
from zipstorer.
Related Issues (20)
- Does it support extracting password protected zip files? HOT 1
- Thanks for giving CIA what they want... HOT 3
- DosTimeToDateTime HOT 2
- Writing a stream - help needed HOT 1
- Remove last zip entry corrupts archive, sometimes. HOT 1
- Large corrupt zip archive takes indefinitely long time to open HOT 1
- Not possible to delete HOT 2
- Not Working Support for Zip64 (file sizes > 4GB) HOT 1
- CA1028: Enum storage should be Int32 HOT 2
- Random AccessDenied when renaming the folder in which the zip contents have been put into HOT 1
- Error encoding 437 .net core 3.1 HOT 2
- InvalidDataException when trying to unzip archive created by php ZipArchive HOT 1
- The library does not notice a file is not in Zip format HOT 1
- Invalid Zip64 extended information record format
- not able to remove one entry
- Blank directory names support (in my case it didn't work by default) HOT 1
- Fixing "Archive is corrupt" while unpacking added to ZIP null-bytes files. HOT 1
- [sharing] Using CP437 in .NET Framework 4.8 HOT 3
- ZipStorer.cs - Security and Compatibility Issues and Fixes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zipstorer.