Giter Site home page Giter Site logo

If overwrite is enabled for unarchive, and the file being overwritten is a symlink, then it tries to follow the symlink, rather than replace it about archiver HOT 12 CLOSED

deitch avatar deitch commented on June 16, 2024
If overwrite is enabled for unarchive, and the file being overwritten is a symlink, then it tries to follow the symlink, rather than replace it

from archiver.

Comments (12)

deitch avatar deitch commented on June 16, 2024 1

Actually, how do I test? v4.Tar doesn't have OverwriteExisting.

from archiver.

deitch avatar deitch commented on June 16, 2024 1

Nope, no need for fs.FS. I just like the (albeit limited) standard interface. I needed a full-purpose one, implemented it, but that doesn't matter here.

Thanks for explaining!

from archiver.

deitch avatar deitch commented on June 16, 2024 1

It is in syft.

FYI, I also have some tar management in go-apk, under here. I wouldn't mind repeating it.

from archiver.

mholt avatar mholt commented on June 16, 2024

Hi, thanks for the issue. I'm no longer supporting v3 though -- does this happen in v4?

from archiver.

deitch avatar deitch commented on June 16, 2024

That is a good question. Now that I have a sample, I can try it out. Reporting back soon.

from archiver.

deitch avatar deitch commented on June 16, 2024

Yeah, it does. I will update the issue. But the fix likely is not the same

from archiver.

deitch avatar deitch commented on June 16, 2024

Actually, one sec. I might have run the wrong thing. I will post back here shortly.

from archiver.

mholt avatar mholt commented on June 16, 2024

D'oh, I'm sorry -- v4 doesn't have OverwriteExisting because we changed how v4 does extractions. Archiver v4 doesn't actually do disk operations, it only does stream operations. So you call Extract() and then you open the files to write to disk, this resolves the issue since you have complete control over it. 💯

from archiver.

deitch avatar deitch commented on June 16, 2024

I am trying to wrap my head around that. So it is similar to fs.WalkDir(), where you provide it a handler, and then do what you want with it?

Come to think of it, does it actually implement fs.FS so that you could use fs.WalkDir() on it?

from archiver.

mholt avatar mholt commented on June 16, 2024

Yes, you can call archiver.FileSystem() to get a fs.FS which you can walk. The extract method is a little similar to walking, and indeed it does let you walk the archive -- it may be more efficient to use Extract though, unless you need fs.FS for something.

from archiver.

mholt avatar mholt commented on June 16, 2024

No problem. Just curious, what are you using archiver for?

Thanks for your detailed issue report btw, would love to see more like that.

from archiver.

mholt avatar mholt commented on June 16, 2024

Cool! We use syft with Caddy as part of our release workflow.

from archiver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.