Graphical Dynamics user community

Get tech support, suggest new features ... let's help each other get the most out of AutoIntern.
It is currently September 9th, 2010, 1:05 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Events that run when file is modified
PostPosted: August 8th, 2008, 11:35 am 
Offline

Joined: March 17th, 2008, 2:03 pm
Posts: 10
Location: County of Sonoma, Calif.
We've been having problems with events that are supposed to run when a file is modified. Sometimes they run twice (not really a problem) and sometimes they don't run at all (definitely a problem). :roll: Right now, I'm having to babysit them all to make sure they run.

Any suggestions on how to make sure that the events run when they are supposed to?


Top
 Profile  
 
 Post subject: Re: Events that run when file is modified
PostPosted: August 8th, 2008, 12:10 pm 
Offline
Site Admin
User avatar

Joined: December 11th, 2006, 1:53 pm
Posts: 92
I'm trying to get it to fail on my machine.

What's the criteria you're using for the files? Is it wildcarded, or is it a specific filename you're monitoring?

Also, do you have any idea of what files, or how many, are changing when this happens?


Top
 Profile  
 
 Post subject: Re: Events that run when file is modified
PostPosted: August 8th, 2008, 12:20 pm 
Offline

Joined: March 17th, 2008, 2:03 pm
Posts: 10
Location: County of Sonoma, Calif.
The two that I'm having the most problems with both have the same criteria: A specific file name, not a wildcard; and "is/are modified" is checked.

One thing that I thought of that might be affecting it. One of the "problem" files seems to be updated at 8:00am (give or take a few minutes) and there is another job that also runs when a file is updated, which usually runs every hour and 1/2 hour (e.g. 8:00, 8:30, 9:00, 9:30, etc). The other problem file usually gets FTPed to our network at the same time as another file, but the 2 files have separate events associated with them. So, could it be that events that run about the same time a causing the other events to not run at all?


Top
 Profile  
 
 Post subject: Re: Events that run when file is modified
PostPosted: August 8th, 2008, 12:22 pm 
Offline
Site Admin
User avatar

Joined: December 11th, 2006, 1:53 pm
Posts: 92
There is one quirk about MS DOS that would confuse AutoIntern: When you copy a file, the new copy's create date/time will be the current date/time, but its modified date/time will be the original file's date/time. An AI event for "when a file is changed" would not catch this new copy being created.

A "when a file is created" event would catch the above scenario, except if there were already files matching a wildcarded filename that the trigger rule specifies. For example, if you were triggering on "a*.*" being created and there's already a "a1.txt" file in the directory, then if "a2.txt" gets created/copied there, AI would not get triggered, since there was already a matching file there.

Also note that renaming a file will not change its modified date.


Top
 Profile  
 
 Post subject: Re: Events that run when file is modified
PostPosted: August 8th, 2008, 12:45 pm 
Offline

Joined: March 17th, 2008, 2:03 pm
Posts: 10
Location: County of Sonoma, Calif.
The modified date for one of the files is 8/8/08 @ 8:01:30am and for the other file is 8/6/08 @ 12:37:26pm. But neither event was triggered at all. I had to start the events manually.


Top
 Profile  
 
 Post subject: Re: Events that run when file is modified
PostPosted: August 8th, 2008, 2:17 pm 
Offline
Site Admin
User avatar

Joined: December 11th, 2006, 1:53 pm
Posts: 92
mbucher wrote:
One thing that I thought of that might be affecting it. One of the "problem" files seems to be updated at 8:00am (give or take a few minutes) and there is another job that also runs when a file is updated, which usually runs every hour and 1/2 hour (e.g. 8:00, 8:30, 9:00, 9:30, etc). The other problem file usually gets FTPed to our network at the same time as another file, but the 2 files have separate events associated with them. So, could it be that events that run about the same time a causing the other events to not run at all?

Let's see... If two events are triggering on the same filename getting modified, but neither event changes the files, then I don't think that would cause any problems, since each event trigger compares the current filetime to its own record of the last filetime that it had triggered on.

But if one (or both) events modifies the file, then yes, I could see one of them getting confused somehow, depending on exactly when the changing happens. Since AI is a multithreaded app, there's no real control over when exactly a given event will check its trigger condition, or when it will do the action, relative to when a similar event checks its trigger or does its action.

Scenario 1: A file gets modified. Event 1 triggers on this change, but doesn't change the file itself. Then Event 2 triggers and does change the file. 10 seconds later, Events 1 and 2 both trigger again.

Scenario 2: A file gets modified. Event 2 triggers first on the change, and changes the file some more. Event 1 triggers because of this latest change but doesn't change the file itself. 10 seconds later, neither Events 1 nor 2 trigger, because they both see the file as up to date.

Scenario 3: A file gets modified. Event 2 triggers first on the change. Event 1 triggers because of the change. Then Event 2's action changes the file. Event 1 does something with the file, but doesn't change it. 10 seconds later, Event 1 triggers again, because Event 2 didn't get to change the file until after Event 1 triggered on the original change. Event 2 does not trigger, because as far as it's concerned it's up to date.


Top
 Profile  
 
 Post subject: Re: Events that run when file is modified
PostPosted: August 8th, 2008, 2:23 pm 
Offline

Joined: March 17th, 2008, 2:03 pm
Posts: 10
Location: County of Sonoma, Calif.
I think that you misunderstood me. I'm not saying that there are 2 events triggered by the same file getting updated. What I meant was that there are two different events, each triggered by different files getting updated, but the 2 files are updated at the same (or almost the same) time.

I.E. File A is updated, which should cause event B to run. A few moments later, file X is updated, which should cause event Y to run. Only event B runs; event Y doesn't run at all. (or vice versa)


Top
 Profile  
 
 Post subject: Re: Events that run when file is modified
PostPosted: August 10th, 2008, 2:36 pm 
Offline
Site Admin
User avatar

Joined: December 11th, 2006, 1:53 pm
Posts: 92
mbucher wrote:
I think that you misunderstood me. I'm not saying that there are 2 events triggered by the same file getting updated. What I meant was that there are two different events, each triggered by different files getting updated, but the 2 files are updated at the same (or almost the same) time.

I.E. File A is updated, which should cause event B to run. A few moments later, file X is updated, which should cause event Y to run. Only event B runs; event Y doesn't run at all. (or vice versa)

Oh, OK. Well, each event keeps its own record of the last modify date/time it detected, so there shouldn't be any way that they would be tripping each other up.

Are you triggering on specific filenames, or are they wildcards? Can you show me the filenames you're specifying?


Top
 Profile  
 
 Post subject: Re: Events that run when file is modified
PostPosted: August 11th, 2008, 10:35 am 
Offline

Joined: March 17th, 2008, 2:03 pm
Posts: 10
Location: County of Sonoma, Calif.
Here are the files that trigger the various events to run:

- \\win\datatransfersroot\auditor\famshare\sonaud (*)
- \\sv-data1\isd-data\ts\common\gis\eocwebactivation\sonomacountyroadcloasuremap.pdf
- s:\ts\common\gis\ftpinternetfiles\par_parcels.zip (*)
- \\win\datatransfersroot\collections\hostdata\sc\collwage
- \\win\datatransfersroot\collections\hostdata\courts\crtswage (*)


The ones marked with asterisk (*) are the ones that usually have a problem not running when the file is updated. And, yes, some of the files do not have extensions.


Top
 Profile  
 
 Post subject: Re: Events that run when file is modified
PostPosted: August 16th, 2008, 12:34 pm 
Offline
Site Admin
User avatar

Joined: December 11th, 2006, 1:53 pm
Posts: 92
Since you're monitoring remote files, I've been doing some tests on remote files here, and on one of our XP machines neither AI's file-modified trigger, nor a WIL file, can see any files on the Win2000 machine. (But another XP box sees it just fine!) Both machines see files & their changes on each other, as does the Win2K box.

So, could you try running this code & see if a WIL script can see any of those directories you're monitoring?

Code:
sPath = "\\win\datatransfersroot"
sSubdirs = DirItemize (sPath)
Message (sPath, sSubdirs)

sPath = "\\sv-data1\isd-data\ts\common"
sSubdirs = DirItemize (sPath)
Message (sPath, sSubdirs)

sPath = "s:\ts\common\gis"
sSubdirs = DirItemize (sPath)
Message (sPath, sSubdirs)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group