use Win32::ChangeNotify; $SCRIPT_PATH= "c:\\scripts"; $SCRIPT = "c:\\scripts\scripts_file"; Win32::ChangeNotify::FindFirst( $Monitor, $SCRIPT_PATH, 1, FILE_NOTIFY_CHANGE_ATTRIBUTES || FILE_NOTIFY_CHANGE_SIZE) || die "Cannot create a change notification object. Error:" . Win32::FormatMessage( Win32::GetLastError() ) . "\n"; print"\n"; open(SFILE,">>$SCRIPT") || die "Cannot open includes for writing:$!"; while( $Monitor->FindNext() ) { print "Monitoring noted filesystems....\n"; $Monitor->Wait( INFINITE ); print "\t A change to $SCRIPT_PATH\n"; } $Monitor->Close(); close(SFILE);
In reply to Monitoring filesystem by raj8
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |