Comments (4)
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.
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.
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.
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)
- 压缩后文件的修改时间不正确
- achiver.directory can't use, error with input source must be valid Stream or Buffer instance error HOT 1
- How to zip single file HOT 1
- Dependency Dashboard
- ESM HOT 1
- .directory() generate a empty folder, compress completed will remove the empty folder,could I retain the empty folder?
- Class extends value undefined is not a constructor or null HOT 1
- Is there a way to know how many files were ultimately compressed? HOT 2
- Question: Were there any API changes from 5.3 to 6.x? HOT 1
- Recommendation for an unzip library? HOT 1
- Overwrite existing files
- Missing Release of Resource after Effective Lifetime [High Severity] HOT 1
- zlib level 0 stops the progress of ongoing read streams
- Improve docs around append callback? HOT 1
- How to convert csv to 7z HOT 1
- Heap out of memory with archiver.append() HOT 1
- Append CSV file line by line
- `append()` fails after upgrading from v6 to v7 HOT 4
- Cannot add file named `\` HOT 2
- Archiver Version 7.0 might be breaking due to ESM HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-archiver.