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

OS::is_process_running function. #51682

Merged
merged 1 commit into from
May 4, 2022

Conversation

mdavisprog
Copy link
Contributor

@mdavisprog mdavisprog commented Aug 15, 2021

This PR adds the OS::is_process_running function that is exposed to script. The function has been implemented for Windows and Unix platforms and provides stubs for other platforms that are unsupported.

This is relevant to the godot-proposal #1679.

A test project is provided that creates a process to run the 'ping' command and asserts that the is_process_running function properly returns the correct value.

os-is-process-running-project.zip

Bugsquad edit: This closes godotengine/godot-proposals#1679.

@mdavisprog mdavisprog marked this pull request as ready for review August 15, 2021 03:27
@mdavisprog mdavisprog requested review from a team as code owners August 15, 2021 03:27
@YeldhamDev YeldhamDev added this to the 4.0 milestone Aug 15, 2021
@mdavisprog mdavisprog force-pushed the os-is-process-running branch from 84383c8 to ccc76c2 Compare August 15, 2021 15:00
@rsubtil
Copy link
Contributor

rsubtil commented May 3, 2022

Came looking for this, this is very much needed for a project I'm working on, any chance of this being merged?

@akien-mga akien-mga added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label May 3, 2022
Adds the is_process_running function to the native OS class and exposes it to script.

This is implemented on Windows and Unix platforms. A stub is provided for other platforms that do not support this function.

Documentation is updated to reflect new API function.
@mdavisprog mdavisprog force-pushed the os-is-process-running branch from ccc76c2 to f3c1232 Compare May 4, 2022 00:27
@mdavisprog
Copy link
Contributor Author

Hello,

I have implemented the feedback and the branch is now rebased with the latest from master. If there is anything else that needs attention, let me know.

@akien-mga akien-mga merged commit 5022efe into godotengine:master May 4, 2022
@akien-mga
Copy link
Member

Thanks!

@MikeSchulze
Copy link

thanks

@akien-mga
Copy link
Member

Cherry-picked for 3.5.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label May 5, 2022
@mdavisprog mdavisprog deleted the os-is-process-running branch May 18, 2022 22:57
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.

Improve OS.kill()'s error handling and add a method is_process_running to check for running processes
5 participants