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

nimscript: cpFile does not copy executable permissions #18211

Open
vitreo12 opened this issue Jun 7, 2021 · 1 comment
Open

nimscript: cpFile does not copy executable permissions #18211

vitreo12 opened this issue Jun 7, 2021 · 1 comment

Comments

@vitreo12
Copy link

vitreo12 commented Jun 7, 2021

When running cpFile in nimscript on an executable binary, permissions are not copied over. This makes the copied binary unusable unless chmod +x is run on it afterwards.

Example

test.nims

cpFile(getCurrentDir() & "/someBinary", getCurrentDir() & "/someBinary1")
nim test.nims

Current Output

./someBinary1 is not executable, ./someBinary is. Permissions differ: ./someBinary1 does not have executable permissions. chmod +x ./someBinary1 fixes it.

Expected Output

./someBinary1 should have executable permissions, since ./someBinary had them.

Nim Compiler Version 1.4.8 [Linux: amd64]
Compiled at 2021-05-25
Copyright (c) 2006-2021 by Andreas Rumpf

git hash: 44e653a9314e1b8503f0fa4a8a34c3380b26fff3
active boot switches: -d:release
@vitreo12
Copy link
Author

vitreo12 commented Jun 7, 2021

Additionally, I've tried to use the setFilePermissions proc from os.nim, but apparently it is not available for NimScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant