System

Functions for dealing with system information. User beware, these can be flakey and hard to use.

GetDriveFreeSpace
Gets how much free space is available on a drive.
GetProcessorName
Gets the processor name of the current machine (ie. "Pentium", "Dual Pentium Pro", etc)
GetSysInfo
Creates a SysInfo file using MakeSysInfoFile and returns a report using GetSysInfoFromFile.
GetSysInfoFromFile
Parses select info out of a SysInfo file created by MakeSysInfoFile.
GetSysInfoPhysicalMemory
Gets info about system memory from a file created by WinMSD.
GetSysInfoProcessors
Gets info about system processors from a file created by WinMSD.
MakeSysInfoFile
Creates a system info file using WinMSD.
PrintMachineStats
Prints out the status of all the machines listed in the ServerStats INI file.
ServerInfo struct
Holds information about a render server.
ServerStats struct
Read and update render server information held in an INI file.

GetDriveFreeSpace:

Gets how much free space is available on a drive. Note: this will briefly pop up a DOS window.

Returns:

The bytes of free space on the specified drive AS A STRING, or undefined on failure.
The return value is a string to avoid overflow issues.

Arguments:
<driveLetter>
String of the drive letter that needs to be checked.

Back to top...


GetProcessorName:

Gets the processor name of the current machine (ie. "Pentium", "Dual Pentium Pro", etc)

Returns:

The name of the processor as a string if possible, otherwise "Unknown Processor".

Arguments:
<procCount>
Number of processors.
<procFamily>
Family of the processor.
<procModel>
Model of the processor.

Back to top...


GetSysInfo:

Creates a SysInfo file using MakeSysInfoFile and returns a report using GetSysInfoFromFile
NOTE: The same warning for MakeSysInfoFile applies to this function.

Returns:

The same thing as GetSysInfoFromFile.

Arguments:
none.

Back to top...


GetSysInfoFromFile:

Parses select info out of a SysInfo file created by MakeSysInfoFile.

Returns:

An array of information, retrieved using other GetSysInfo... functions, or undefined on failure. Currently, the array holds the equivelent of:
#(
ComputerNameString,
(GetSysInfoProcessors()),
(GetSysInfoPhysicalMemory()),
)

Arguments:
none.

Back to top...


GetSysInfoPhysicalMemory:

Gets info about system memory from a file created by WinMSD.

Returns:

An integer value of the amount of RAM (in KB) in the system, or 0 on failure.

Arguments:
<sysInfoFile>
Pointer to an open file returned by GetSysInfoFile.

Back to top...


GetSysInfoProcessors:

Gets info about system processors from a file created by WinMSD.

Returns:

An array of arrays, one for each processor found, or an empty array on failure.
Each array holds four integers:

ar[1]: the (approximate) speed of the processor
ar[2]: the processor family
ar[3]: the processor model
ar[4]: the processor stepping

Arguments:
<sysInfoFile>
Pointer to an open file returned by GetSysInfoFile.

Back to top...


MakeSysInfoFile:

Creates a system info file using WinMSD.
NOTE: This is a cheap hack, and should be avoided when possible. It must be customized to the system it is run on, and can potentially hang the system for up to a minute.

Returns:

A filename string pointing to the file created by WinMSD report feature, or undefined on failure.

Arguments:
none.

Back to top...


PrintMachineStats:

Prints out the status of all the machines listed in the ServerStats INI file.
If there is a "*" in the first column, then that machine's info is possibly out of date. The info can be updated by running ServerStats.UpdateServerInfo "machineName" from that machine.

Returns:

OK

Arguments:
[sortBy:#serverName]
Sorts the printout by specified name property. Useful name values include:
#serverName
#processorSpeed
#physicalMemory

Back to top...


ServerInfo struct:

Holds information about a render server. Use ServerList.GetServerInfo() to get one filled out. This struct is pretty specialized, and should be used with caution.

Available Members:
serverName:""
Name of the server.
infoVersion:0
Version of the info held in this ServerInfo record.
numProcessors:0
Number of processors in the server.
processorSpeed:0
Approximate speed of the server.
processorFamily:0
Processor family number
processorModel:0
Processor model number
physicalMemory:0
Amount of physical memory in machine, in megs.
lockID:0
An integer hardware lock ID (or 0 if there's no lock, ie. it's a renderfarm slave).

Back to top...


ServerStats struct:

Read and update render server information held in an INI file. This struct is pretty specialized, and should be used with caution.

Available Members:
serverListFile:"R:\MAX3master\ServerList.ini"
File holding a list of servers.
Available Functions:
GetMasterInfoVersion
Get the current master version number. If a serverInfo's infoVersion member is less than this when UpdateServerInfo is called, then the serverInfo record in the serverListFile is updated.
GetServerCount
Gets the number of servers in the serverListFile.
SetServerCount
Sets the number of servers in the serverListFile.
GetServerName <i>
Gets the name of the i'th server in the serverListFile.
AddServer <serverName>
Adds the server to the serverListFile.
GetServerInfo <serverName>
Gets a ServerInfo struct filled out with a server's information, or adds a server to the serverListFile and returns a fresh ServerInfo struct if the passed server isn't in the list.
UpdateServerInfo <serverName>
Updates the info in the serverListFile. This should only be called from the machine being passed in (serverName).

Back to top...