Re: knowing when file has been totally transferred
- From: "Michel Posseth [MCP]" <MSDN@xxxxxxxxxxx>
- Date: Mon, 17 Apr 2006 17:52:57 +0200
open the file in a try catch block and use
FileShare.None as the share parameter to a FileStream object
you might wrap this in a nice function
regards
Michel Posseth [MCP]
"chad" <chad@xxxxxxxxxxxxxxxxxxxxxxxxx> schreef in bericht
news:577F14C8-A022-45D1-BCF8-409FA09D8D85@xxxxxxxxxxxxxxxx
uhm..... what method do you use when you wanna find out if we get
exclusive
access to the file?
"Michel Posseth [MCP]" wrote:
Well i would do the following
i would use a filesystem watcher to detect the arrival of the file (
Created event ) this event will fire as soon as the transfer starts
however it will also provide us the location and name of the file so we
can
wait in a loop untill we can get exclusive access to the file
when this is possible we know that the file is completely transfered
regards
Michel Posseth [MCP]
"chad" <chad@xxxxxxxxxxxxxxxxxxxxxxxxx> schreef in bericht
news:E09788E6-8E4F-4C3B-BA31-5FB1608859C5@xxxxxxxxxxxxxxxx
let's say I'm transferring a large file like 100MB over to a folder.
The program detects when the file arrives. However, I can't
figure out how to know when the file is totally transferred over.
One unsuccessful method is to...
dim fi as new fileinfo(newfile)
fi.length returns the supposed size of the file. But it correctly
reports the final size of the file the moment transferring
starts. So that's no help at all.
I want to know what the file is totally transferred to the folder
so I can then begin to work on it. Any ideas?
.
- Follow-Ups:
- Re: knowing when file has been totally transferred
- From: Chris Dunaway
- Re: knowing when file has been totally transferred
- References:
- Re: knowing when file has been totally transferred
- From: Michel Posseth [MCP]
- Re: knowing when file has been totally transferred
- Prev by Date: Re: collection question
- Next by Date: stopping current execution
- Previous by thread: Re: knowing when file has been totally transferred
- Next by thread: Re: knowing when file has been totally transferred
- Index(es):
Relevant Pages
|