--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com
"sbparsons" <sbpa...@discussions.microsoft.com> wrote in message
news:7128A17F-9BFA-427B...@microsoft.com...
>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)
As Nicholas said, if you can't control the client process you're kinda stuck
with try...catch.
"Nicholas Paldino [.NET/C# MVP]" <m...@spam.guard.caspershouse.com> wrote in
message news:e7UEhHsY...@TK2MSFTNGP02.phx.gbl...