-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add FileAttributes.Executable as a possible FileAttribute #925
Comments
What should it do on Windows? |
As FileStatus.Unix.cs ignores Windows attributes (e.g. Hidden, Directory and many others), Windows code should ignore |
Makes sense. Would this be for file owner only ( |
Yes |
Thanks, I think this is ready for review, they meet once a week so it may be a little bit. |
This was about making existing APIs work as best as possible. There's a higher bar for new APIs.
Just as a point of order, executable is 1. 7 is Read (4) | Write (2) | Execute (1). |
I don’t know if there is a concept of “Execute” permission on Windows, it’s about file extensions. What would you do in that case? |
Why does it need to be on FileAttributes? Can you use the Mono.Posix nuget package and just call its Chmod (or P/Invoke to chmod directly)? |
Yes, I could use Mono.Posix.NetStandard or P/Invoke. When I was looking for "chmod" on this project, looking for a way to On the other hand, I see that SetAttributes covers everything you need on windows, but it doesn't cover everything you need on Linux. So yeah, I could P/Invoke, but I think that a dev coding a linux app should have the same tools and level of abstraction than a guy coding a windows app. If one can set a file hidden the other should be able to make it executable. |
Interesting. Is there any progress on this issue? |
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process. This process is part of our issue cleanup automation. |
This issue will now be closed since it had been marked |
Introduction
With File.SetAttributes we can modify some file permissions, such as ReadOnly or ReadWrite, but we can't set Executable (a.k.a. 7) permission. I think we have everything we need on FileStatus.Unix.cs so we can do something like:
It should call chmod setting a 7.
Usage
Some possible usage is when you need to download a zip file. You know that you have an app inside, but you need to change the mode to 7 to be able to execute it.
The text was updated successfully, but these errors were encountered: