-
Notifications
You must be signed in to change notification settings - Fork 10
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
Create new functions for setting handle inheritable flag #23
base: main
Are you sure you want to change the base?
Conversation
Let me think about this. My initial reaction is that this should go into win32-file if anywhere. |
Thanks! I didn't know about win32-file before. I was just following what was already being done in win32-process to set the filehandles to be inheritable. In the case of win32-file, would win32-file have this functionality and then in the future win32-process would depend on win32-file in order to use it? |
@dustymabe That's the preliminary idea. I'll probably let this stew for a bit, though. |
hey @djberg96 any update? |
@dustymabe None, I'm afraid. I've actually been looking for people to take over maintenance of my win32* libraries because I just don't need them any more, and I haven't been dedicating the time that I should to them. |
Thanks for the candid response. I wish ruby itself would pick up proper support for this in the language so it wasn't required for it to be maintained outside of the main packages. I have a solution that works so don't worry about this for now. |
@dustymabe just a quick update that the chef folks are now maintaining the win32 stuff. |
thanks! are they keeping it in this repo? |
@dustymabe Yep, this is the right place. |
@tpowell-progress @dustymabe ~ do you still need this? |
It's been a while, but I think it would still be useful. |
I've found a case where it would be useful to mark windows file handles as inheritable or not inheritable in a process. In win32-process the
SetHandleInformation
function is a private function and is not supposed to be accessed outside of the class. It would be generally useful to have this functionality exposed so that users of win32-process could set this information on file handles.Here is a commit where I accessed the private methods of the win32-process module in order to achieve the desired effect: dustymabe/vagrant-sshfs@6f285cd
In this commit I expose a few higher level functions that will allow users to easily set the inheritable flag for a handle. You can see how one would use these functions in the following commit which is the diff I would make to the code to go from my previous (hacky) implementation to the new one: dustymabe/vagrant-sshfs@78e942d
Would it be reasonable to expose these functions to the users?