I can add Win32-ChangeNotify functionality to a either my existing or a new DLL. I could notify on one or a combination of:
code:
   ATTRIBUTES   Any attribute change
DIR_NAME Any directory name change
FILE_NAME Any file name change (creating/deleting/renaming)
LAST_WRITE Any change to a file's last write time
SECURITY Any security descriptor change
SIZE Any change in a file's size

Here is an example script of my prototype DLL:
code:
$= SetOption("WrapAtEol","On")
? "KiXtart version = " @KIX

$HABObject1 = createobject("HBullock.AdminObjects")
if vartypename($HABObject1) <> "Object"
? "@serror"
endif


$ChangeNotify = $HABObject1.NewChangeNotify ("c:\data\scripts", 1, "FILE_NAME")
? "@error @serror"
?
$ChangeNotify.print
? "@error @serror"

$result = $ChangeNotify.wait
Cerror()
? "@error @serror"

? "result = " + $result
if $result
? "Something changed"
else
? "Failure " + @error
endif


Function Cerror()
exit Iif(@error<0,VAL("&"+Right(DecToHex(@error),4)),@error)
Endfunction

I should be able to create mutliple instances of various $ChangeNotify objects, but a problem in t my Perl code is presently preventing that from occurring.

Another example:
break ON


$= SetOption("WrapAtEol","On")
? "KiXtart version = " @KIX

$HABObject1 = createobject("HBullock.AdminObjects")
if vartypename($HABObject1) <> "Object"
? "@serror"
endif


$ChangeNotify1 = $HABObject1.NewChangeNotify ("c:\data\scripts", 1, "FILE_NAME")
? @error
$ChangeNotify2 = $HABObject1.NewChangeNotify ("c:\data\scripts", 1, "SIZE")
? @error

while (1)
do
$i = 1+ $i
$result1 = $ChangeNotify1.wait(100) ; milliseconds
$result2 = $ChangeNotify2.wait(100) ; milliseconds
? "Timeout: " + $i
until $result1 <> 0 or $result2 <> 0

if $result1
? "FILE_NAME: Something changed"
$ChangeNotify1.reset
;Do Something about it...
endif
if $result2
? "SIZE: Something changed"
$ChangeNotify2.reset
;Do Something about it...
endif
loop


[ 08. October 2003, 22:12: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/