Directory Monitor

More
5 years 6 months ago - 5 years 6 months ago #20723 by admin
Replied by admin on topic Directory Monitor
Just to clarify what directory monitor actually does

Directory monitor reacts to windows file system events

Such as

File creation (Added)
Deletion (Removed)
ETC

Let talk about File creation

File creation is just file creation and nothing else

You can have the following situation.

1 File is created and it is open for writing
2 Data is written into the file.
3 File is closed

The event fires at step number 1 and our software then wait until the file is closed and then submit the package for execution.

Or the software (FTP client, FTP server, explorer) may create an empty file to check if the remote directory actually writable
It does happen quite often.


1 File is created
2 File is deleted.
3 File is created and it is open for writing
4 Data is written into the file.
5 File is closed

What we can do we can add an option to ignore empty files.
That however does not mean that it will help in your case.

Also

"If you notice, even if the tmp file did come in, it has an extension of .tmp and the pattern is for *.csv. so at the very least it still should have ignored the *.tmp until it became .csv"

In this case, you should monitor for "Rename event", and not "Add file event"

Mike
ETL Architect
Last edit: 5 years 6 months ago by admin.

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago - 5 years 6 months ago #20728 by bruce.gibbins
Replied by bruce.gibbins on topic Directory Monitor
Thanks Mike. yes, understand all of that and how the monitor works as I have used the Windows API directly myself in a small way in the past. In your implementation is the filename filter used at detection time or after?

I ask because in our case I would still believe that only a single Event should be registered because even though I can see the client side FTP PUT a file with an extension of .TMP
Code:
filename.csv.tmp
and then within milliseconds FTP MOVE the file to
Code:
filename.csv
- there is still only a single .CSV file created.

We are only monitoring for *.csv yet we get 2 Execution Log Event entries and as you say this method of 'testing' the server before commiting the final file is common. However, in this scenario if the filename filtering kicked in during the 'watching' I would have through we would still only get a single Event being created rather than 2.

Also, whilst I appreciate the offer of ignoring zero sized file I would thinks this could be problematic for your other clients and also in this case the file actually seems to not be zero for very long

Attachments:
Last edit: 5 years 6 months ago by bruce.gibbins.
The following user(s) said Thank You: admin

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago #20729 by bruce.gibbins
Replied by bruce.gibbins on topic Directory Monitor
Hi

Just want to add that I have the following methods to try and troubleshoot and in ALL cases 2 files events are created. The first tow methods were purposely done to hopefully avoid any chance of 2 files being created.

1. On the SERVER Drag & Drop file from Windows Explorer from a samples folder to the SHARE open in another window. This is totally under my control and there is NO temporary file initially created and I am not doing any probing to see if the file or directory pre-exist.

2. On the SERVER COPY&Paste from Windows Explorer from a samples folder to the SHARE open in another window. This is totally under my control and there is NO temporary file initially created and I am not doing any probing to see if the file or directory pre-exist.

3. On my Dev Workstation open up WinSCP and connect to the FTP Home as if I was the external client. DRAG&DROP the sample file from Windows Explorer to the WinSCP File Area. This generates a PUT of a file with .TMP extension and a MOVE of that file to the CSV extension. WinSCP must be doing this.

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago #20732 by admin
Replied by admin on topic Directory Monitor
Here is the gentleman who is having similar problems to yours.

forum.powerbasic.com/forum/user-to-user-...enotification-double

We are still not able to reproduce the problem I think the only way for us to do so is to buy the same NAS storage as yours

I after spending so much time reading about problems with writing file system monitors my conclusion that API created by Microsoft is not 100% reliable.

It does apply to both local folders and network shares.

We will create a special build of a directory monitor for you and provide you with the link.

Again there is no 100 per cent guarantee that we will be able to fix the problem

Mike
ETL Architect

Please Log in or Create an account to join the conversation.

More
5 years 5 months ago #20872 by bruce.gibbins
Replied by bruce.gibbins on topic Directory Monitor
Thanks for the fix in v6.3.7.16

cheers

Please Log in or Create an account to join the conversation.

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save