<html>
<head>
<title>firstworks   Programming with Rudiments using the sys class</title>
<link href="../css/styles.css" rel="stylesheet">
</head>
<body>

<span class="heading">Using the sys class</span><br><br>

<ul>
<li><a href="#intro">Introduction</a></li>
<li><a href="#info">Getting System Information</a></li>
<li><a href="#reboot">Reboot</a></li>
<li><a href="#shutdown">Shutdown</a></li>
<li><a href="#halt">Halt</a></li>
</ul>

<br>
<a name="intro"></a>
<h3>Introduction</h3>

<p>The <a href="../classes/html/classsys.html">sys class</a> provides methods for getting information about the operating system and controlling the state of the operating system.</p>

<br>
<a name="info"></a>
<h3>Getting System Information</h3>

<p>In this example, various bits of system information are printed out.</p>

<blockquote class="code">
@sys.cpp.html@
</blockquote>

<p>Note that not all systems support every piece of information.  If a piece of information is unsupported, then a -1 is returned.</p>

<br>
<a name="reboot"></a>
<h3>Reboot</h3>

<p>This example reboots the system, when run as root or Administrator.</p>

<blockquote class="code">
@reboot.cpp.html@
</blockquote>

<br>
<a name="shutdown"></a>
<h3>Shutdown</h3>

<p>This example performs a graceful system shutdown, when run as root or Administrator.</p>

<blockquote class="code">
@shutdown.cpp.html@
</blockquote>

<br>
<a name="halt"></a>
<h3>Halt</h3>

<p>This example performs a less-graceful system halt, when run as root or Administrator.</p>

<blockquote class="code">
@halt.cpp.html@
</blockquote>

</body>
</html>
