Shutdown function or shell command

Forum thread started by fortheloveofhaiku on Sun, 2010-12-12 00:54

Hey All, does any one know if there is a C++ function or a command i can call from the shell that can shutdown/restart haiku or would i have to create a separate function in my application?

Thanks guys :-)

Comments

Re: Shutdown function or shell command

There was a topic that was talking about this and other things a month or so ago.

http://www.haiku-os.org/community/forum/why_cant_i_make_desktop_shutdown...

Re: Shutdown function or shell command

use:
shutdown

to turn off the computer. or

shutdown -r

to restart the computer

Re: Shutdown function or shell command

Ok great, does Haiku support 'system("shutdown")' for example , I could pull that off in linux pretty snappy but im unsure about Haiku.

Re: Shutdown function or shell command

I don't know what you mean by 'system("shutdown")' .

shutdown is a binary file in /boot/system/bin and can be used as any bin file can.

Re: Shutdown function or shell command

Remember i am trying to call a binary ( aka the shutdown) binary from C++ in my application so what would i need to use to invoke a system command from C++ is essentially what im asking.

Re: Shutdown function or shell command

Ok i figured it out thanks :-) Got the application to tell the OS to shutdown with

void MainWindow::shutdown()
{
system("shutdown");
}