I had to solve this problem - identifying if a file is executable or not - in another crate I was working on and my solution needed to work with Windows. I discovered that one can use the GetBinaryTypeW function from the Windows API to accomplish this. Figured you might be interested in including this solution for Windows in your crate as well.
I don't think this can really work on Windows. A python file might be executable, but not a windows binary. SHGetFileInfo at least claims to support batch files.
I had to solve this problem - identifying if a file is executable or not - in another crate I was working on and my solution needed to work with Windows. I discovered that one can use the GetBinaryTypeW function from the Windows API to accomplish this. Figured you might be interested in including this solution for Windows in your crate as well.