plugin system.spf

File: system.spf
Author: Nicholas Nemtsev
Description: Additional words helping to monitor the use of system memory. They provide information about system memory use; based on this information, you can decide whether or not you need to use any memory management utilities.

New words:


MemLoad

Returns current memory usage (in percents)

Example:

#( test_memload
Action:
    MemLoad 90 >
    IF
        BALLOON: "MemLoad Warning" "More then  90%PERCENT% of available memory is used"
    THEN
)#

TotalPhys

Returns the amount of total physical memory in bytes.

Example:

\ outputting the value to nnCron console and to nncron.out
TotalPhys . CR

AvailPhys

Returns the amount of available physical memory in bytes.

Example:

\ outputting the value to nnCron console and to nncron.out
AvailPhys . CR

TotalPageFile

Total possible size, in bytes, of the paging file. Note that this number does not represent the actual physical size of the paging file on disk.

Example:

\ outputting the value to nnCron console and to nncron.out
TotalPageFile . CR

AvailPageFile

Size, in bytes, of space available in the paging file. The operating system can enlarge the paging file from time to time. The dwAvailPageFile member shows the difference between the size of current committed memory and the current size of the paging file—it does not show the largest possible size of the paging file.

Example:

\ outputting the value to nnCron console and to nncron.out
AvailPageFile . CR

TotalVirt

Total size, in bytes, of the user mode portion of the virtual address space of the calling process.

Example:

\ outputting the value to nnCron console and to nncron.out
TotalVirt . CR

AvailVirt

Size, in bytes, of unreserved and uncommitted memory in the user mode portion of the virtual address space of the calling process.

Example:

\ outputting the value to nnCron console and to nncron.out
AvailVirt . CR

GetVolID ( letter -- serial_number)

This postfix word takes drive-letter as an argument and returns single signed decimal number, that represents Volume ID (volume serial number) of the specified disk.

See also: GET-VOL-ID


GET-VOL-ID ( letter -- a u)

This postfix word takes drive-letter as an argument and returns a string, that represents Volume ID (volume serial number) of the specified disk (in HEX format). You can use such a string, for example, to identify specific compact-disk when it is inserted into CD-ROM drive.

GET-VOL-ID will return the string '0' if the program can not get Volume ID (disk is unreachable or compact-disc is not inserted into CD-ROM drive).

To place a drive-letter to a stack the words CHAR and [CHAR] are used. The word CHAR is used at run-time (in console, for example):

CHAR F GET-VOL-ID TYPE CR

And the word [CHAR] is used at compile-time (when defining tasks in your crontabs):

#( test_volid
NoActive
Action:
    \ printing drive F: Volume ID to console:
    [CHAR] F GET-VOL-ID TYPE CR
)#

Пример:

#( test_volid1
WatchDrive: "F" 
Action:
    \ pausing for 20 seconds to let compact disk to 'spin up'
    PAUSE: 20000
    S" 35405AED" [CHAR] F GET-VOL-ID COMPARE 0=
    IF
        \ some useful action if the strings with Volume ID are the same
    THEN 
)#