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

Add support for --delete option #192

Open
nuest opened this issue Jul 27, 2018 · 3 comments
Open

Add support for --delete option #192

nuest opened this issue Jul 27, 2018 · 3 comments
Labels
Enhancement new feature or improvement

Comments

@nuest
Copy link

nuest commented Jul 27, 2018

I need to replace a file in the tar, and get the desired result (see #149). I would prefer though to delete the file first and then re-append it.

Would you consider adding a tar.delete, as described in https://www.gnu.org/software/tar/manual/html_section/tar_32.html#SEC66 ?

@isaacs
Copy link
Owner

isaacs commented Oct 10, 2018

I'd be open to it.

In the meantime, you could work around this by creating a new archive with a filter function.

tar.create({
  filter: entry => entry.path !== 'foo.txt' // the file to be deleted
  file: 'new.tar'
}, ['@old.tar']).then(() => fs.renameSync('new.tar', 'old.tar'))

I imagine that's more or less how gnutar does it?

@yusufkhan07
Copy link

@nuest The tar.delete link you provided is broken.

@darcyclarke darcyclarke added the Enhancement new feature or improvement label Jul 28, 2022
@iQuickDev
Copy link

@nuest The tar.delete link you provided is broken.

this is the working link https://www.gnu.org/software/tar/manual/tar.html#delete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement new feature or improvement
Projects
None yet
Development

No branches or pull requests

5 participants