hi
I'm pretty new to VB.net and looking for some advice, any pointers will be much appreciated
I'm writing a small application that downloads some files over ftp, the incoming directory is monitored by FileSystemWatcher_Created, on creation I want to extract some text from the file and call another application with the text as parameters
the problem I have is the FileSystemWatcher_Created procedure is triggered before the file has finished downloading, I could download it elsewhere and move into the monitored directory but some of the files may be quite large and Im wondering if there is an efficient way of waiting until the file is ready?
along the same lines what is the best way to queue the tasks as there can be many files coming it at one time, I've looked at threading but would that be suitable for such a task as there will still be a bottleneck at the application called by FileSystemWatcher_Created ?
heres an outline of what im doing:
I'm pretty new to VB.net and looking for some advice, any pointers will be much appreciated
I'm writing a small application that downloads some files over ftp, the incoming directory is monitored by FileSystemWatcher_Created, on creation I want to extract some text from the file and call another application with the text as parameters
the problem I have is the FileSystemWatcher_Created procedure is triggered before the file has finished downloading, I could download it elsewhere and move into the monitored directory but some of the files may be quite large and Im wondering if there is an efficient way of waiting until the file is ready?
along the same lines what is the best way to queue the tasks as there can be many files coming it at one time, I've looked at threading but would that be suitable for such a task as there will still be a bottleneck at the application called by FileSystemWatcher_Created ?
heres an outline of what im doing:
VB.NET:
Private Sub FileSystemWatcher1_Created(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Created
'read text file
text = [read the text file here]
'incoming class calls the application with parameters
Dim incoming As New incomingClass()
incoming.parameters = text
incoming.incoming()