[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

Telling if a Process is writing to a file

Phil A

10/21/2002 12:38:00 PM

Hi,
Is there any way with .Net to tell if another process is
writing to a file and to more explicitly to obtain a
notification once that process finishes with the file?

If not, can I do this with win32 via interop? If so can
you give me a pointer (as I know nothing about win32)?

The best idea that I have had so far is to use the
WaitForChanged on FileSystemWatcher, but this isn't as
clean as I would hope.

Thanks in advance,
Phil
2 Answers

Phil Wilson

10/29/2002 10:32:00 PM

0

See if NetFileEnum might help.

"Phil" <phil.almond@valtech.co.uk> wrote in message
news:8d6a01c278f6$6f5cb5f0$3bef2ecf@TKMSFTNGXA10...
> Hi,
> Is there any way with .Net to tell if another process is
> writing to a file and to more explicitly to obtain a
> notification once that process finishes with the file?
>
> If not, can I do this with win32 via interop? If so can
> you give me a pointer (as I know nothing about win32)?
>
> The best idea that I have had so far is to use the
> WaitForChanged on FileSystemWatcher, but this isn't as
> clean as I would hope.
>
> Thanks in advance,
> Phil


Phil Wilson

10/31/2002 1:29:00 AM

0

My mistake - NetFileEnum doesn't do locally open files.

"Phil Wilson" <phil.wilson@unisys.spamcom> wrote in message news:OUMU4J5fCHA.2284@tkmsftngp11...
> See if NetFileEnum might help.
>
> "Phil" <phil.almond@valtech.co.uk> wrote in message
> news:8d6a01c278f6$6f5cb5f0$3bef2ecf@TKMSFTNGXA10...
> > Hi,
> > Is there any way with .Net to tell if another process is
> > writing to a file and to more explicitly to obtain a
> > notification once that process finishes with the file?
> >
> > If not, can I do this with win32 via interop? If so can
> > you give me a pointer (as I know nothing about win32)?
> >
> > The best idea that I have had so far is to use the
> > WaitForChanged on FileSystemWatcher, but this isn't as
> > clean as I would hope.
> >
> > Thanks in advance,
> > Phil
>
>