Greetings,
When dealing with VMWare guests, it is often imposible to keep systems truly in sync. One time test could show the VMWare guest as much as 45 seconds off from the VMWare server time. This function perform a fuzzy check against a returned unix time. The function accepts a parameter which indicates the variation allowed between the returned unix time and the server's current time.
Example: {host:custom[time].fuzzytime(30)} will return 1 if the value of custom[time] is greater than current time minus 30 seconds and less than current time plus 30 seconds, 0 otherwise.
NOTE: I haven't had time for anything but the most rudimentary tests. YMMV.
EDIT: Forgot to mention, this is meant to be used with the new vfs.file.[cm]time and system.localtime items.
EDIT: Corrected example to show the correct fuzzytime usage.
EDIT: 09 Sep 05 -- Corrected a minor bug and updated to works agains the current CVS
When dealing with VMWare guests, it is often imposible to keep systems truly in sync. One time test could show the VMWare guest as much as 45 seconds off from the VMWare server time. This function perform a fuzzy check against a returned unix time. The function accepts a parameter which indicates the variation allowed between the returned unix time and the server's current time.
Example: {host:custom[time].fuzzytime(30)} will return 1 if the value of custom[time] is greater than current time minus 30 seconds and less than current time plus 30 seconds, 0 otherwise.
NOTE: I haven't had time for anything but the most rudimentary tests. YMMV.
EDIT: Forgot to mention, this is meant to be used with the new vfs.file.[cm]time and system.localtime items.
EDIT: Corrected example to show the correct fuzzytime usage.
EDIT: 09 Sep 05 -- Corrected a minor bug and updated to works agains the current CVS

Comment