-
Notifications
You must be signed in to change notification settings - Fork 7
this_process
Alairion edited this page May 8, 2021
·
2 revisions
Defined in header <nes/process.hpp>
namespace this_process{}
nes::this_process
namespace represents the current process. It can be used to get the current process id, the current process working directory, and to modify the current process working directory.
Function | Description |
---|---|
get_id |
Returns the current process's id |
working_directory |
Returns the current process's working directory |
change_working_directory |
Changes the current process's working directory |
Here is an example in which we display informations about the process.
#include <iostream>
#include <nes/process.hpp>
int main()
{
std::cout << "Current process has id " << nes::this_process::get_id() << std::endl;
std::cout << "Its current directory is \"" << nes::this_process::working_directory() << "\"" << std::endl;
}
Current process has id 42
Its current directory is "/"