Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deno.copyFileSync not preserving permissions on MacOS #16921

Closed
dragonstyle opened this issue Dec 3, 2022 · 0 comments · Fixed by #17412
Closed

Deno.copyFileSync not preserving permissions on MacOS #16921

dragonstyle opened this issue Dec 3, 2022 · 0 comments · Fixed by #17412
Assignees
Labels
bug Something isn't working correctly runtime Relates to code in the runtime crate

Comments

@dragonstyle
Copy link

Starting with Deno 1.25.4, we are seeing file permissions not being preserved when a file is copied on MacOS. A simple reproducible example is as follows:

// Clean test files
try {
  Deno.removeSync("start.txt");
} catch {}

try {
  Deno.removeSync("finish.txt");
} catch {}

// Write a test file with execute permissions
console.log("Writing File");
Deno.writeTextFileSync('start.txt', "Hello World");
Deno.chmodSync("start.txt", 0o100755);

// Log the starting permissions
const statStart = Deno.statSync("start.txt");
console.log(`[${statStart.mode}] start.txt`);

// Copy the file
Deno.copyFileSync('start.txt', 'finish.txt')

// Log the copied file permissions
const statFinish = Deno.statSync("finish.txt");
console.log(`[${statFinish.mode}] finish.txt`);

This causes us issues in particular as the execute permission for some files are being lost when copied, causing downstream permission errors when those copies are attempted to be executed.

Seems potentially related to #15873 and the MacOS specific file copy performance improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly runtime Relates to code in the runtime crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants