SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
DirWaitForUpdate

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
DirWaitForUpdate
Author Message
Kelly Grandstaff



Joined: 12 Aug 2004
Posts: 4

Post DirWaitForUpdate Reply with quote

The error I get does not happen all of the time, but I have been seeing it more recently.
I am using DirWaitForUpdate to watch a directory for files then running another job when files are found.
As I said the error does not happen all of the time but is becoming more frequent.

Here is the error:
FileWatch_test An error occurred while executing automation script: Line 20: The handle is invalid.

I am running v3.4.18 on winXP.

Any help would be appreciated

Thu Aug 12, 2004 10:06 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: DirWaitForUpdate Reply with quote

Please post your script.

: The error I get does not happen all of the time, but I have been seeing it
: more recently.
: I am using DirWaitForUpdate to watch a directory for files then running
: another job when files are found.
: As I said the error does not happen all of the time but is becoming more
: frequent.

: Here is the error: FileWatch_test An error occurred while executing
: automation script: Line 20: The handle is invalid.

: I am running v3.4.18 on winXP.

: Any help would be appreciated

Thu Aug 12, 2004 10:35 am View user's profile Send private message
Kelly Grandstaff



Joined: 12 Aug 2004
Posts: 4

Post Re: DirWaitForUpdate Reply with quote

: Please post your script.
Dim local_computer, string
Dim status_message, string
Dim change_found, boolean
Dim bln_FileExists, Boolean
Dim process_id, number
Dim initial_dir, string "\\\\ServerName\\100\\"
Dim search_dir, string

set local_computer "@V"computer""
Upper( local_computer, local_computer )
concatex ("File Watch processor running on ", "@V"computer"", status_message)
logaddmessageex ("INFO", "@V"job_id"" , "@V"job_name"", status_message)

START:
concatex initial_dir, "*.txt", search_dir
FileExists search_dir, bln_FileExists
if bln_FileExists runit, Wait_for_it

Wait_for_it:
DirWaitForUpdate initial_dir, 0, change_found

// OK, some change is found
runit:

Wait 20
JobRun( "SomeJob" )
Wait 20

// start watching again
GoTo START

Thu Aug 12, 2004 10:41 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: DirWaitForUpdate Reply with quote

DirWaitForUpdate is wacthing all changes not just new files. As result the rest of your script may run when a file is deleted or updated in that directory causing false starts.

I suggest to replace

DirWaitForUpdate initial_dir, 0, change_found

with simple

Wait 5
GoTo START

: Dim local_computer, string
: Dim status_message, string
: Dim change_found, boolean
: Dim bln_FileExists, Boolean
: Dim process_id, number
: Dim initial_dir, string "\\\\ServerName\\100\\"
: Dim search_dir, string

: set local_computer "@V"computer""
: Upper( local_computer, local_computer )
: concatex ("File Watch processor running on ",
: "@V"computer"", status_message)
: logaddmessageex ("INFO", "@V"job_id"" ,
: "@V"job_name"", status_message)

: START: concatex initial_dir, "*.txt", search_dir
: FileExists search_dir, bln_FileExists
: if bln_FileExists runit, Wait_for_it

: Wait_for_it: DirWaitForUpdate initial_dir, 0, change_found

: // OK, some change is found
: runit: Wait 20
: JobRun( "SomeJob" )
: Wait 20

: // start watching again
: GoTo START

Thu Aug 12, 2004 10:52 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.