home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2004 April
/
PCWorld_2004-04_cd.bin
/
software
/
temacd
/
remotany
/
RemotelyAnywhere.msi
/
CheckCDrive.sma
next >
Wrap
Text File
|
2003-08-19
|
3KB
|
104 lines
////////////////////////////////////////////////////////////////////////////////
// //
// RemotelyAnywhere Sample 'SMALL' Scripts //
// //
// RemotelyAnywhere provides a mechanism for scripting via a built-in //
// language. The language is called Small, and more information about //
// it can be found at http://compuphase.com/small.htm. //
// //
// Before you use these sample scripts, you should tailor their //
// behavior to better suit your configuration and your needs. //
// //
// THIS SOFTWARE IS PROVIDED BY 3AM LABS LTD ``AS IS'' AND //
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE //
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE //
// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE //
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL //
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS //
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) //
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT //
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY //
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF //
// SUCH DAMAGE. //
// //
////////////////////////////////////////////////////////////////////////////////
#include <ra>
main ()
{
//
// Declare and initialize variables
//
new perf, retval;
new time = raGetTime();
htmlBeginOutput("Free Space On Drive C");
//
// Query RA performance data. We are passing time-10 as the second
// parameter, meaning that we want to see the latest available data.
//
retval = raGetPerformance(PERF_DRIVE, time-10, perf, 'C');
//
// Did we succeed?
//
if (retval == 0)
{
//
// Report the error.
//
htmlWrite("There was an error retrieving performance data ");
htmlWrite("from RemotelyAnywhere.");
}
else
{
//
// The variable perf contains the percentage retrieved from RA.
// It represents the disk space in use, so we subtract it from
// 100 to get the disk usage.
//
perf = 100 - perf;
//
// Convert it to a string
//
new str[64];
sprintf(str, "%d", perf);
//
// Display the output
//
htmlWrite("Free space on drive C is ");
htmlWrite(str);
htmlWrite(" percent.");
}
//
// Display a 'Back' button.
//
htmlBeginForm();
htmlButtonBack("Back", false);
htmlEndForm();
//
// We are done.
//
htmlEndOutput();
}