Click here to Skip to main content
16,005,316 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# Windows Service Pin
Pete O'Hanlon8-Jun-11 22:18
mvePete O'Hanlon8-Jun-11 22:18 
GeneralRe: C# Windows Service Pin
scotlandc8-Jun-11 22:22
scotlandc8-Jun-11 22:22 
AnswerRe: C# Windows Service Pin
AspDotNetDev8-Jun-11 22:46
protectorAspDotNetDev8-Jun-11 22:46 
GeneralRe: C# Windows Service Pin
MicroVirus9-Jun-11 3:41
MicroVirus9-Jun-11 3:41 
AnswerRe: C# Windows Service Pin
ShadowUz8-Jun-11 22:40
ShadowUz8-Jun-11 22:40 
AnswerRe: C# Windows Service Pin
ramzg8-Jun-11 23:02
ramzg8-Jun-11 23:02 
GeneralRe: C# Windows Service Pin
scotlandc9-Jun-11 0:46
scotlandc9-Jun-11 0:46 
AnswerRe: C# Windows Service Pin
Luc Pattyn9-Jun-11 1:42
sitebuilderLuc Pattyn9-Jun-11 1:42 
Hi,

as others already explained, FSW has a limited buffer, so for a very active folder you might miss some events, however that seldom is the problem; the actual problem typically is FSW gets triggered by the beginning of some action (such as file creation), whereas your app typically is interested in the end of the action (file created and available).

My solution (applies only if the producer can be slightly changed) is by using a sentinel file: have the producer create and write the file of interest first, then emit a small file that signals the former has been created and written; and now make the FSW watch out for that sentinel file only; it being small causes start and end creation to coincide, so there is no need to wait or to retry. And you could store the data file's name inside the sentinel file, to remove all uncertainty.

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Please use <PRE> tags for code snippets, they improve readability.
CP Vanity has been updated to V2.4

GeneralRe: C# Windows Service Pin
RobCroll9-Jun-11 3:55
RobCroll9-Jun-11 3:55 
AnswerRe: C# Windows Service Pin
Luc Pattyn9-Jun-11 3:59
sitebuilderLuc Pattyn9-Jun-11 3:59 
GeneralRe: C# Windows Service Pin
RobCroll11-Jun-11 19:54
RobCroll11-Jun-11 19:54 
AnswerRe: C# Windows Service Pin
Luc Pattyn12-Jun-11 1:29
sitebuilderLuc Pattyn12-Jun-11 1:29 
GeneralRe: C# Windows Service Pin
AspDotNetDev9-Jun-11 8:01
protectorAspDotNetDev9-Jun-11 8:01 
AnswerRe: C# Windows Service Pin
Luc Pattyn9-Jun-11 8:14
sitebuilderLuc Pattyn9-Jun-11 8:14 
GeneralRe: C# Windows Service Pin
AspDotNetDev9-Jun-11 8:28
protectorAspDotNetDev9-Jun-11 8:28 
AnswerRe: C# Windows Service Pin
Luc Pattyn9-Jun-11 8:53
sitebuilderLuc Pattyn9-Jun-11 8:53 
QuestionCallbackOnCollectedDelegate exception when using DDE to get URLs from Navigators Pin
moums8-Jun-11 13:54
moums8-Jun-11 13:54 
Questionstring formate Pin
jashimu8-Jun-11 8:20
jashimu8-Jun-11 8:20 
AnswerRe: string formate Pin
Ennis Ray Lynch, Jr.8-Jun-11 8:29
Ennis Ray Lynch, Jr.8-Jun-11 8:29 
AnswerRe: string formate Pin
mabrahao8-Jun-11 9:07
mabrahao8-Jun-11 9:07 
AnswerRe: string formate Pin
AspDotNetDev8-Jun-11 9:16
protectorAspDotNetDev8-Jun-11 9:16 
AnswerRe: string formate Pin
AspDotNetDev8-Jun-11 9:15
protectorAspDotNetDev8-Jun-11 9:15 
GeneralRe: string formate Pin
jashimu8-Jun-11 11:04
jashimu8-Jun-11 11:04 
AnswerRe: string formate Pin
Pete O'Hanlon8-Jun-11 10:55
mvePete O'Hanlon8-Jun-11 10:55 
GeneralRe: string formate Pin
AspDotNetDev8-Jun-11 11:38
protectorAspDotNetDev8-Jun-11 11:38 

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.