Mapped FTP Windows 2008 R2: Watch Extender

Started by rickmds, January 11, 2015, 07:17:16 AM

Previous topic - Next topic

rickmds

HI
I have successfully set up the watch extender to poll local and mapped drives for the arrival of new files to process.  I have now mapped an FTP folder (attached image MarshDaily) on a Windows 2008 R2 server and would like to monitor it with the Watch extender.  Is there a way to do this?  I have experimented with FTPUSE and NETDrive in order to assign the Mapped FTP a drive letter but there are some incompatibilities and a problem with refresh when new files are added. 

Any suggestions or alternative approaches are welcome.  Thanks in advance.
Rick


ChuckC

I'm not familiar with the inner workings of the Watcher extender, but if it is making use of the Win32 API functions that receive a notification each time that a change is made to the content of a directory, then there are some basic assumptions about the watched directories that need to be true for the functions to work properly.  The primary assumption is that if the drive letter is connected to a remote UNC path, then the UNC path must be for a LANMAN share on a remote Windows server; otherwise, the "watching for changes" API function simply doesn't work properly.

In your case, using a network client that allows the usage of the FTP protocol to access an FTP server and present its content as if it were being accessed via a drive letter connected to a remote share simply fails to meet the assumptions and requirements of the underling Win32 API functions that are being used to watch for changes.

Look up the following topics in the MSDN Library:  FindFirstChangeNotification(), FindNextChangeNotification() and ReadDirectoryChangesW().


Now, if the extender isn't making use of those Win32 API functions, the the above discussion doesn't apply and I'd hazard to guess that the author of the Watcher extender will have to chime in with a response to help identify what might be going wrong.

td

I have no idea who the author is but a quick perusal of the extender DLL with a hex editor does indeed show that it is using the  "watching for changes" API.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

ChuckC

OK, then that pretty much nails down the source of the problem as it relates to using FTP as the file sharing protocol.  Those API functions simply aren't going to work properly in that situation.

rickmds

Thanks everyone for providing this information. 

Given what has been provided, are there any suggestions on polling an FTP location using WinBatch?  I believe I can use the WinInt extender, coupled with a loop and the timewait() function to accomplish this but did not want to re-invent the wheel if there is an existing solution.  Thanks!

td

The WinInet extender seems like a fairly straight forward approach.  Most of the other solutions are shell based and would run into the same problems the Watch Extender has.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade