Click here to Skip to main content
15,915,319 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: 1.1 or 2.0 Pin
Abhinav S6-Feb-10 22:19
Abhinav S6-Feb-10 22:19 
AnswerRe: 1.1 or 2.0 Pin
Luc Pattyn7-Feb-10 2:22
sitebuilderLuc Pattyn7-Feb-10 2:22 
AnswerRe: 1.1 or 2.0 Pin
Luc Pattyn7-Feb-10 8:55
sitebuilderLuc Pattyn7-Feb-10 8:55 
GeneralRe: 1.1 or 2.0 Pin
Roger Wright9-Feb-10 19:11
professionalRoger Wright9-Feb-10 19:11 
GeneralRe: 1.1 or 2.0 Pin
Luc Pattyn10-Feb-10 1:10
sitebuilderLuc Pattyn10-Feb-10 1:10 
GeneralRe: 1.1 or 2.0 Pin
Roger Wright10-Feb-10 2:13
professionalRoger Wright10-Feb-10 2:13 
GeneralRe: 1.1 or 2.0 Pin
Luc Pattyn10-Feb-10 2:53
sitebuilderLuc Pattyn10-Feb-10 2:53 
QuestionIdeas on how to design a file listener Pin
rune7116-Feb-10 7:19
rune7116-Feb-10 7:19 
I'm working on a project that uses the System.IO.FileSystemWatcher to monitor a folder. What I'm wanting to do is copy select types of files from the monitored folder when they are created. This works pretty slick, but the problem I run into is that the FileSystemWatcher event oftentimes fires before the file finishes copying, so copying the file results in an error.

I resolved this by creating a timer that's started on the FileSystemWatcher.created event. It waits a reasonable amount of time and then copies the file. No issues.

My problem is that this isn't a very good solution, particularly when hundreds or thousands of files are being copied onto the watched drive, as this can result in thousands of threads.

I wanted to resolve this by having the FileSystemWatcher.created thread add the files to be copied to an arrayList, then have a separate single thread monitor the array... wait for the file to be available to be copied, then start copying files. However this has more problems since the arrayList collection is changed on a separate thread which introduces a lot of locking issues, which I'd rather avoid.

Can anyone offer an idea of what the best practice for this situation would be? I appreciate any input. Laugh | :laugh:

Thanks!

Dana
AnswerRe: Ideas on how to design a file listener Pin
Luc Pattyn6-Feb-10 8:45
sitebuilderLuc Pattyn6-Feb-10 8:45 
AnswerRe: Ideas on how to design a file listener Pin
Pete O'Hanlon6-Feb-10 10:04
mvePete O'Hanlon6-Feb-10 10:04 
AnswerRe: Ideas on how to design a file listener Pin
Alexey Malyshev7-Feb-10 11:50
Alexey Malyshev7-Feb-10 11:50 
QuestionQSB like Interface Pin
volatil3_5-Feb-10 8:45
volatil3_5-Feb-10 8:45 
QuestionProblem Converting Hex to Decimal Pin
VikashGohil5-Feb-10 3:15
VikashGohil5-Feb-10 3:15 
GeneralRe: Problem Converting Hex to Decimal Pin
harold aptroot5-Feb-10 3:32
harold aptroot5-Feb-10 3:32 
AnswerRe: Problem Converting Hex to Decimal Pin
Ennis Ray Lynch, Jr.5-Feb-10 4:28
Ennis Ray Lynch, Jr.5-Feb-10 4:28 
AnswerRe: Problem Converting Hex to Decimal Pin
Eddy Vluggen5-Feb-10 4:32
professionalEddy Vluggen5-Feb-10 4:32 
AnswerRe: Problem Converting Hex to Decimal Pin
VikashGohil7-Feb-10 2:34
VikashGohil7-Feb-10 2:34 
QuestionUse RegAsm -> SuccessFul but failure in creating object of com wrapped dotnet dll Pin
nlarson114-Feb-10 11:18
nlarson114-Feb-10 11:18 
AnswerRe: Use RegAsm -> SuccessFul but failure in creating object of com wrapped dotnet dll Pin
Eddy Vluggen5-Feb-10 3:37
professionalEddy Vluggen5-Feb-10 3:37 
QuestionInterview questions for web developer Pin
sweety19884-Feb-10 11:05
sweety19884-Feb-10 11:05 
AnswerRe: Interview questions for web developer Pin
Ennis Ray Lynch, Jr.4-Feb-10 11:10
Ennis Ray Lynch, Jr.4-Feb-10 11:10 
AnswerRe: Interview questions for web developer Pin
Not Active4-Feb-10 11:26
mentorNot Active4-Feb-10 11:26 
GeneralRe: Interview questions for web developer Pin
Pete O'Hanlon5-Feb-10 4:51
mvePete O'Hanlon5-Feb-10 4:51 
AnswerRe: Interview questions for web developer Pin
Dave Kreskowiak4-Feb-10 12:51
mveDave Kreskowiak4-Feb-10 12:51 
AnswerRe: Interview questions for web developer Pin
Rozis4-Feb-10 13:29
Rozis4-Feb-10 13:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.