mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
Permission Denied when executing extracted executable file from Tar #424
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lmtr0 on GitHub (Nov 3, 2020).
Hello I ran this code to extract an executable out of a tarfile and when I tried running it the terminal returns:
Can you help me?
@lmtr0 commented on GitHub (Nov 3, 2020):
I used tar.bz2 compression and the code is:
@adamhathcock commented on GitHub (Nov 3, 2020):
That's likely because your executable file you made
maindoes not have permissions to execute. Nothing to do with sharpcompress@lmtr0 commented on GitHub (Nov 3, 2020):
thats the problem, when i extract it with the built in Archive extractor, It works
@lmtr0 commented on GitHub (Nov 3, 2020):
I search it a little more and saw that Sharcompress alters the permissions on a file
@lmtr0 commented on GitHub (Nov 3, 2020):
This is the executable outputted by the compiler
This is the executable after compression and decompression
@adamhathcock commented on GitHub (Nov 3, 2020):
I don't think Sharpcompress does the right thing in setting or preserving the permissions of a file
@lmtr0 commented on GitHub (Nov 3, 2020):
Can i remove this?
@lmtr0 commented on GitHub (Nov 3, 2020):
@adamhathcock is there any configuration for me to remove this, this configuration kind of messed up all my program configuration
@lmtr0 commented on GitHub (Nov 3, 2020):
Also Something that doesn't make any sense:

when I unpack the windows app version the permission is leaved as default:
@lmtr0 commented on GitHub (Nov 3, 2020):
Here is what I did
@lmtr0 commented on GitHub (Nov 3, 2020):
On linux, mac and FreeBSD(I believe, I have to check this info thought) the executable doesn' t have an extension, so I check for this and just give the file permission, But i would be cool If It can do it automatically
@adamhathcock commented on GitHub (Nov 4, 2020):
Thanks for posting your solution
@lmtr0 commented on GitHub (Nov 4, 2020):
I am looking for something more cross platform, because this only work on Unix-like system, and I didn't test it on apple's systems, And I am Also looking for a solution for windows
@lmtr0 commented on GitHub (Nov 10, 2020):
This seems to be the only option