davglass / cpr

Nodejs cp -R
Other
79 stars 80 forks source link

Preserve file mode of newly-created files #43

Closed evocateur closed 6 years ago

evocateur commented 7 years ago

I was copying a bunch of fixtures into a temp directory one day, and then I kept getting weird return codes (error code 126 wat) when I tried to call executable files in those copied fixtures. I found out that the copied files were no longer 0777, but 0666 (the default mask for files).

Sacré bleu!

Turns out fs.createWriteStream() has a mode option that we should probably use.

Related to #34, but not a complete solution.

davglass commented 6 years ago

Manually ported this in 17b0494af1b173a30e82e0d8c69297f4376d6cbb

Published in cpr@3.0.0