Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7z list bug with no datetime info #11

Closed
evandro777 opened this issue Dec 4, 2015 · 6 comments
Closed

7z list bug with no datetime info #11

evandro777 opened this issue Dec 4, 2015 · 6 comments
Assignees

Comments

@evandro777
Copy link

I found a bug in list in files which doesn't have date/time info, it's not usual i think, but i've found files like these:
7z_stdout.txt

I have made a fix in the file "lib/list.js" that worked for me:
Line 23: var regex = /([\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}]+) ([.DA]+) +(\d+)[ \d]+ (.+)/;
Line 56: if(parseInt(res[1])){ var return_date = new Date(res[1]); }
Line 57: else{ var return_date = ""; }
Line 58: var e = {
Line 59: date: return_date,

The changed file:
list.txt

@q2s2t q2s2t self-assigned this Dec 7, 2015
@q2s2t
Copy link
Owner

q2s2t commented Mar 28, 2016

I am trying to reproduce the error via this function.
Does files modified by this function generate the same errors as the one you mentioned ?

@q2s2t
Copy link
Owner

q2s2t commented May 24, 2016

hello, i tried to reproduce the error but could not find how to create a file with no timestamp
could you provide a way to do so ? or even a file ?

@evandro777
Copy link
Author

Sorry for the delay. I did a stop in my project that i was using node-7z.
I'll send you a file.
I opened it in gnome archive manager and shows a date (31/12/1969, 21:00). But i think it's forcing a date.
This files i get in Mame Roms.
They are generated with Torrent7z.

https://sourceforge.net/projects/t7z/

The goal of the program is to use standard values when creating 7z to create identical files over multiple systems. So if i compress my files here, they will get the same hash of someone else.
One of the standard to keep the same hash is to remove the datetime.

Here is one example file (github doesn't allow upload 7z).
Download: http://www.filedropper.com/1943
Mirror: http://s000.tinyupload.com/index.php?file_id=37667808932816462805

@q2s2t
Copy link
Owner

q2s2t commented May 30, 2016

thanks for the file. in my file browser (Finder) all 3 dates are set to today.
what is the function (or sys call) you use to remove the datetime ? did you just set it to unix epoch ?

@evandro777
Copy link
Author

It's been some time since i've made the change.
As far i can remember. In list.js:
In this section:

var e = {
  date: new Date(res[1]),
  attr: res[2],
  size: parseInt(res[3], 10),
  name: res[5].replace(path.sep, '/')
};

I've just checked if has a date, then uses new Date(), else, just send empty. And aparently solved the issue.

if(parseInt(res[1])){ var return_date = new Date(res[1]); }
else{ var return_date = ""; }

var e = {
  date: return_date,
  attr: res[2],
  size: parseInt(res[3], 10),
  name: res[5].replace(path.sep, '/')
};

@q2s2t
Copy link
Owner

q2s2t commented Dec 5, 2018

Closed in v1.0.0
Check the README to adapt your code to the new API

@q2s2t q2s2t closed this as completed Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants