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

regress in https://github.com/npm/node-tar/issues/81 ? #217

Closed
Dzenly opened this issue Jun 7, 2019 · 3 comments
Closed

regress in https://github.com/npm/node-tar/issues/81 ? #217

Dzenly opened this issue Jun 7, 2019 · 3 comments

Comments

@Dzenly
Copy link

Dzenly commented Jun 7, 2019

Probably there is regress in #81

@Dzenly
Copy link
Author

Dzenly commented Jun 8, 2019

Seems like file name limited to 99 characters.

The tar cmd line utility allows to use 99+ characters, so behaviour of your module is non standard and this must be documented in readme.

According to this doc
https://www.gnu.org/software/tar/manual/html_section/tar_67.html
it corresponds to old v7 format.

Is there an ability to switch the format to gnu or posix?
I did not found related options in the readme.md.

@Dzenly Dzenly changed the title regress in https://github.com/npm/node-tar/issues/81 regress in https://github.com/npm/node-tar/issues/81 ? Jun 8, 2019
@isaacs
Copy link
Owner

isaacs commented Jun 30, 2019

It does not seem that way to me. Can you try running this minimal test script and tell me what you get as a result?

https://gist.github.com/isaacs/fd8e135cf2a38aa0425f40ad4aa3b481

Node-tar uses the PAX/Posix header by default when the filename is longer than 99 characters. It does not use the Gnu style LongFilename or LongLinkname entries, but it will interpret them if present.

What are you using to unpack or list the file?

@Dzenly
Copy link
Author

Dzenly commented Jun 30, 2019

Hi!
Indeed, the problem was in my midnight commander settings.

# .tgz, .tpz, .tar.gz, .tar.z, .tar.Z, .ipk, .gem
regex/\.t([gp]?z|ar\.g?[zZ])$|\.ipk$|\.gem$
        Open=%cd %p/utar://
        View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar.gz

So my mc does truncate longname in artefacts/longname-archive-node-tar.tgz
But does not in artefacts/longname-archive-system-tar.tgz.

So, sorry for false alarm and thank you for answer.

This is the output:

node-tar v4.4.10
system tar is:
tar (GNU tar) 1.30
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
OK
110 // console.log(longName.length);
create with node-tar
create with system tar
OK
created with node tar, list with node-tar
very long file name a s dd f df sdfsdfsdfsdfsdffffffff~fffffsdddddddddddddddddddddddddddssssssssssssssssss.xml
created with node-tar, list with system-tar
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
very long file name a s dd f df sdfsdfsdfsdfsdffffffff~fffffsdddddddddddddddddddddddddddssssssssssssssssss.xml
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
OK
created with system tar, list with node-tar
very long file name a s dd f df sdfsdfsdfsdfsdffffffff~fffffsdddddddddddddddddddddddddddssssssssssssssssss.xml
created with system tar, list with system-tar
very long file name a s dd f df sdfsdfsdfsdfsdffffffff~fffffsdddddddddddddddddddddddddddssssssssssssssssss.xml
OK
Waiting for the debugger to disconnect...

Process finished with exit code 0

@Dzenly Dzenly closed this as completed Jun 30, 2019
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