How to find out which file is being accessed via FTP?

  • Thread starter Thread starter Brett
  • Start date Start date
B

Brett

I'd like to create a small client app that sits on a user's computer and
monitors their FTP activity to one certain server. The client app will
update a server app that then distributes this information to all client
apps. This means if 5 people are using the client app and are accessing the
server via FTP, they will see which files are being accessed by others that
are also using FTP.

Consider each client will be using their own FTP program but I will know
ahead of time what it is. Any bird's eye view suggestions on how I would go
about doing this?

Thanks,
Brett
 
One way to get started monitoring files is the FileWatcher:

watchfolder.NotifyFilter = IO.NotifyFilters.DirectoryName
watchfolder.NotifyFilter = watchfolder.NotifyFilter Or _
IO.NotifyFilters.FileName
watchfolder.NotifyFilter = watchfolder.NotifyFilter Or _
IO.NotifyFilters.Attributes
watchfolder.NotifyFilter = watchfolder.NotifyFilter Or _
IO.NotifyFilters.LastAccess

' add the handler to each event
AddHandler watchfolder.Changed, AddressOf logchange
AddHandler watchfolder.Created, AddressOf logchange
AddHandler watchfolder.Deleted, AddressOf logchange

where logchange displays the change information. Problem is that this line
for example:

AddHandler watchfolder.Changed, AddressOf logchange

watchfolder only has these attributes:
- changed
- created
- deleted
- error
- renamed

Meaning the IO.NotifyFilters.LastAccess will never trigger. If some one
opens the file, they are accessing it but doing none of the above five
listed events. Is there a way to get a trigger on file access even if the
user is only reading? In other words, a file open.

Brett
 
Back
Top