By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,162 Members | 1,416 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,162 IT Pros & Developers. It's quick & easy.

C# Threading Issue

P: n/a
Hello,

I am currently having an issue with the FileSystemWatcher class for an
application I am developing. I use the FileSystemWatcher class to
identify a change in a directory (i.e. a file has been added) and once
this event is captured then I make a call to another class which
implements calls to a camera SDK.

The issue I am having is that when using FileSystemWatcher to create a
new version of my class and start making calls to an asynchronous
camera capture() method, the call is made and then when check
has_captured flag, this is always immediately set to complete although
now picture has been taken. When I call to this class however from a
basic console application the call to the capture() method is made and
then the has_captured flag is only set once a picture has been taken
as I would expect.

I have therefore started to think it may have something to do with the
event thread that is fired when using the FileSystemWatcher class.

Can anybody provide any input to this issue.

Many thanks in advance,

Phil

Jan 30 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 30 Jan, 16:58, "PhilBray" <PhilB...@gmail.comwrote:
I am currently having an issue with the FileSystemWatcher class
It may or may not be related to your problem, but if you search this
newsgroup for recent posts containing "FileSystemWatcher", somebody
else had a similar problem to you where the file creation event was
firing before the creating application had finished writing it.

Jan 30 '07 #2

P: n/a
Hi,

"PhilBray" <Ph******@gmail.comwrote in message
news:11**********************@h3g2000cwc.googlegro ups.com...
| Hello,
|
| I am currently having an issue with the FileSystemWatcher class for an
| application I am developing. I use the FileSystemWatcher class to
| identify a change in a directory (i.e. a file has been added) and once
| this event is captured then I make a call to another class which
| implements calls to a camera SDK.
|
| The issue I am having is that when using FileSystemWatcher to create a
| new version of my class and start making calls to an asynchronous
| camera capture() method, the call is made and then when check
| has_captured flag, this is always immediately set to complete although
| now picture has been taken. When I call to this class however from a
| basic console application the call to the capture() method is made and
| then the has_captured flag is only set once a picture has been taken
| as I would expect.
|
| I have therefore started to think it may have something to do with the
| event thread that is fired when using the FileSystemWatcher class.

It's possible, but IMO this depend of the camera you are using and how you
should comunicate with it. Also note that sometimes the FileSystemWatcher
fires more than one event for the same action from the file. I would also
check for this.

How you communicate with the camera?

Jan 30 '07 #3

P: n/a
On Jan 30, 5:15 pm, "Bobbo" <robin.willi...@choicequote.co.ukwrote:
On 30 Jan, 16:58, "PhilBray" <PhilB...@gmail.comwrote:
I am currently having an issue with the FileSystemWatcher class

It may or may not be related to your problem, but if you search this
newsgroup for recent posts containing "FileSystemWatcher", somebody
else had a similar problem to you where the file creation event was
firing before the creating application had finished writing it.
Hi Bobbo,

I resolved the issue but it was related to the build path I was using
when using the FileSystemWatcher application. For some reason I was
not getting all the required SDK DLL's brought into my build directory
at runtime.

All is now good but thanks for the fast response.

Phil

Jan 31 '07 #4

P: n/a
On Jan 30, 8:15 pm, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA
laceupsolutions.comwrote:
Hi,

"PhilBray" <PhilB...@gmail.comwrote in message

news:11**********************@h3g2000cwc.googlegro ups.com...
| Hello,
|
| I am currently having an issue with the FileSystemWatcher class for an
| application I am developing. I use the FileSystemWatcher class to
| identify a change in a directory (i.e. a file has been added) and once
| this event is captured then I make a call to another class which
| implements calls to a camera SDK.
|
| The issue I am having is that when using FileSystemWatcher to create a
| new version of my class and start making calls to an asynchronous
| camera capture() method, the call is made and then when check
| has_captured flag, this is always immediately set to complete although
| now picture has been taken. When I call to this class however from a
| basic console application the call to the capture() method is made and
| then the has_captured flag is only set once a picture has been taken
| as I would expect.
|
| I have therefore started to think it may have something to do with the
| event thread that is fired when using the FileSystemWatcher class.

It's possible, but IMO this depend of the camera you are using and how you
should comunicate with it. Also note that sometimes the FileSystemWatcher
fires more than one event for the same action from the file. I would also
check for this.

How you communicate with the camera?
Hi,

I resolved the issue but it was related to the build path I was using.

Thanks for the response.

Phil

Jan 31 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.