Re: File Activity
From: Ralph (msnews.20.nt_consulting32_at_spamgourmet.com)
Date: 01/05/05
- Next message: Mike D Sutton: "Re: on.time"
- Previous message: GregS: "Re: on.time"
- In reply to: Bill-R: "File Activity"
- Next in thread: Bob O`Bob: "Re: File Activity"
- Reply: Bob O`Bob: "Re: File Activity"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 5 Jan 2005 11:45:32 -0600
"Bill-R" <BillR@yahoo.com> wrote in message
news:%239CnPRo8EHA.2112@TK2MSFTNGP14.phx.gbl...
> Is there any way to determine when File activity has finished?
>
> I have a App. that updates a 60mg Data File. I close the file after the
> update.
> Then reopen it in another module.
>
> Sometimes the file has not Physically been updated before I try to use it
> again.
>
You can use FindFirstChangeNotification with a FILE_NOTIFY_CHANGE_LAST_WRITE
flag. Followed by various wait and FindNextChangeNotification. This flag is
generally good at not signaling until the cache is empty.
But as Randy pointed out it could still be a 'crap-shoot' since depending on
load and whatever other stuff is going on, there is no way to know for
absolute certainty that everything has been written out.
We had a similar situation and managed it by having the first app close the
data file, then write out a small "done" file. The second process then
merely waited for the "done" file. Again - likely not a 100% reliable, but
appeared to work often enough for our purposes on a moderately busy box.
hth
-ralph
- Next message: Mike D Sutton: "Re: on.time"
- Previous message: GregS: "Re: on.time"
- In reply to: Bill-R: "File Activity"
- Next in thread: Bob O`Bob: "Re: File Activity"
- Reply: Bob O`Bob: "Re: File Activity"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|