JuliaIO / Tar.jl

TAR files: create, list, extract them in pure Julia
MIT License
79 stars 19 forks source link

Windows extract: always chmod files #85

Closed StefanKarpinski closed 3 years ago

StefanKarpinski commented 3 years ago

@staticfloat has informed me that on Windows newly created files are neither reliably executable nor non-executable: it depends on the ACL of the directory in which the file is created. So this PR changes the logic for setting permissions to check that the executableness of the file in the tarball and the extracted file match and if not, then use chmod to make it so. This logic is the same everywhere, it just happens that on non-Windows platforms files aren't created with execute bits set (I think; if they are, we'll now handle it properly, i.e. by turning them off for non-executable files).

codecov[bot] commented 3 years ago

Codecov Report

Merging #85 (e5b74e6) into master (0e9d388) will increase coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #85      +/-   ##
==========================================
+ Coverage   96.37%   96.38%   +0.01%     
==========================================
  Files           4        4              
  Lines         635      637       +2     
==========================================
+ Hits          612      614       +2     
  Misses         23       23              
Impacted Files Coverage Δ
src/extract.jl 96.29% <100.00%> (+0.02%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0e9d388...e5b74e6. Read the comment docs.

StefanKarpinski commented 3 years ago

I'm pretty sure this is right, just gonna merge it.