S
sbparsons
I need to write an app that picks up images from a folder and does some work
on them (resize, compress etc). The folder in which the images reside has a
FileSystemWatcher triggering events when files are dropped in.
I need to be able to determine when the file is ready to be accessed by my
app, as some of the files may be large and the copy procedure may take some
time (in the order of seconds). I have the LastWrite filter set on my FSW but
that raises the changed event - which is also raised at other (seemingly
random) times - and there is no info in the event raised that it is the
LastWrite stage of the action.
Is there any exact way of determining when the file is available? This is
through a windows service so can't use the Win32 SHFileOperation api call...
(and a 'try - catch' solution isn't ideal)
on them (resize, compress etc). The folder in which the images reside has a
FileSystemWatcher triggering events when files are dropped in.
I need to be able to determine when the file is ready to be accessed by my
app, as some of the files may be large and the copy procedure may take some
time (in the order of seconds). I have the LastWrite filter set on my FSW but
that raises the changed event - which is also raised at other (seemingly
random) times - and there is no info in the event raised that it is the
LastWrite stage of the action.
Is there any exact way of determining when the file is available? This is
through a windows service so can't use the Win32 SHFileOperation api call...
(and a 'try - catch' solution isn't ideal)