but i am facing a weird problem. i need to go to the directory and refresh it manually (simple F5 refresh on that directory) to update the file size.
What do you need to refresh? Do you mean the file system browser? That has nothing to do with your task. Just copy the file when you want to.
The file system can notify you when a change has occurred. But none of this has anything to do with the Windows Shell.
If you're using ReadDirectoryChanges() then you're doing the right thing.
What do you need to refresh? Do you mean the file system browser?
yes, thats the weird problem.
i know that ReadDirectoryChangesW() is doing it's job fine.
here is what happens..
1) my process is running in background.
2) it is not copying files or showing signs of FILE_NOTIFY_CHANGE_SIZE.
3) when i refresh(or sometimes just visit) the directory which is being monitored by ReadDirectoryChangesW()
from windows explorer my program detects changes in file system and copies the file.
that means the file size gets updated when i visit the directory(or refresh) from windows explorer.
The notification is asynchronous. I found that when the file system is busy, the notification can be considerably delayed.
Have you tried periodically running dir from a console to see if it triggers notification too? If it does, you can possibly do that in the background periodically to wake up the notification system.
by console do you mean command line? yes i tried to access it from command line, to trigger file size notification i need to perform some operation on that file like xcopy (which fails because of access restrictions but thats ok).