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

Add File.executable? for Windows #9677

Merged
merged 3 commits into from
Nov 16, 2022

Conversation

nof1000
Copy link
Contributor

@nof1000 nof1000 commented Aug 15, 2020

No description provided.

@hugopl
Copy link
Contributor

hugopl commented Sep 10, 2020

See spec/std/file_spec.cr:135, there are some tests tagged as pending there for this that should be unskipped.

@straight-shoota
Copy link
Member

@nof1000 Looks good 👍 Would you care enabling the mentioned specs for this?

@straight-shoota
Copy link
Member

@nof1000 Are you still up to continue with this?

@straight-shoota straight-shoota removed the pr:needs-work A PR requires modifications by the author. label Apr 14, 2021
@HertzDevil
Copy link
Contributor

This part can probably be enabled for Windows:

private def self.is_executable_file?(path)
unless File.info?(path, follow_symlinks: true).try &.file?
return false
end
{% if flag?(:win32) %}
# This is *not* a temporary stub.
# Windows doesn't have "executable" metadata for files, so it also doesn't have files that are "not executable".
true
{% else %}
File.executable?(path)
{% end %}
end

@oprypin
Copy link
Member

oprypin commented Nov 24, 2021

@HertzDevil Enabled in what sense?
Are you referring to the part that says it's *not* a temporary stub?
Well, I'm saying again, that implementation is complete and passes https://github.com/crystal-lang/crystal/blob/master/spec/manual/find_executable_spec.cr

Copy link
Member

@sdogruyol sdogruyol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @nof1000 🙏

@straight-shoota straight-shoota added this to the 1.7.0 milestone Nov 15, 2022
@straight-shoota straight-shoota changed the title Add File.executable? for Windows Add File.executable? for Windows Nov 15, 2022
@straight-shoota straight-shoota merged commit 9f4fed0 into crystal-lang:master Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants