Giter Site home page Giter Site logo

Comments (4)

julianpoemp avatar julianpoemp commented on June 6, 2024 1

For anyone who faces this issue in 2023 using Typescript: You can add the file permissions for zip via mode attribute:

zip.append(content, {
  mode: 0o755
}

Before setting this extracted files on MacOS had read permissions only.

from node-archiver.

ctalkington avatar ctalkington commented on June 6, 2024

i actually believe you can define permissions as part of the zip "external file attritubutes", however, its a bit fun due to bitmasks and such. if you calculate the proper information, you can set externalFileAttributes which isn't advertised but should pass through to underlying header API and write it as UInt32LE..

http://unix.stackexchange.com/a/14727

Tar also has an un-advertised mode that you should be able to pass things like 0777 to.

These extra data keys are available due to way header API works but wont be fully supported until the header API is extended to support them with a normalized helper. There is currently no ETA on that but def something that is going to happen sooner than later.

from node-archiver.

gimenete avatar gimenete commented on June 6, 2024

Ok. I didn't know about that mode. But it's just what I was looking for. This worked like a charm

tar.append(data,{name:'run.sh', mode:0755}, callback)

Thank you Chris!

from node-archiver.

ctalkington avatar ctalkington commented on June 6, 2024

no problem. I recently had refactored the header api to be more in line with spec including tar filename prefix. all these formats have their own little gotchas and I learn more about them each day through this project.

from node-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.