Re: file system events (FileSystemWatcher)
From: Allen Anderson (allen_at_sparkysystems.com)
Date: 02/11/04
- Next message: C# Learner: "Re: Encoding... sigh."
- Previous message: Jon Maz: "Re: How can I get Http Status Code?"
- In reply to: Jeffrey Tan[MSFT]: "RE: file system events (FileSystemWatcher)"
- Next in thread: Jeffrey Tan[MSFT]: "Re: file system events (FileSystemWatcher)"
- Reply: Jeffrey Tan[MSFT]: "Re: file system events (FileSystemWatcher)"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 11 Feb 2004 09:10:05 -0700
Hi Jeff, thanks for your reply.
In the example you stated, you are surely right that what happens in
memory can't be seen on disk, however this doesn't really matter in
what I need. I am trying to find a way to be notified when a file has
been created and closed. My current problem is that I'm being
notified just as the file starts writing to disk.
I can solve this problem by simply taking the notification, then
waiting till the file is no longer blocked, but I was hoping there was
a notification that did that already.
Cheers,
Allen
On Wed, 11 Feb 2004 07:59:05 GMT, v-jetan@online.microsoft.com
("Jeffrey Tan[MSFT]") wrote:
>
>Hi Allen,
>
>Thank you for posting in the community!
>
>Based on my understanding, you use the FileSystemWatcher class to monitor
>all the xml files in certan directory. But you want to find a way to know
>when a file's I/O is over.
>
>=========================================
>Let's use Notepad editing as an example.
>
>For a file being editing, its content is loaded in the memory, so when user
>use notepad to edit the xml file, it only changes the memory content of
>this xml file, the file system knows nothing about this change. The file
>system will be notified when you use save method to flush the memory
>content to the disk.
>
>If the notepad has saved the content, the file system will have not chance
>to know the future behavior it will do with the xml file:
>1). It may just close(I think this is what you means the change is over)
>2). It may edit the content again, and save it to the disk.
>
>At this point, you will see that, the change over control is not due to the
>File System, but the file editor's process. So I think what you want does
>not make much sense.
>
>Also, we can not say that this can not be done in windows. Because you may
>find all the file handle owners of the xml file. But the file handle owner
>is being maintained in kernal mode, you must P/invoke some un-documented
>APIs to get this done.(I think this is not what you want)
>
>For a little start point of the un-documented API about this, please refer
>to:
>http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&frame=right&th=d
>392ffdb818c5665&seekm=vL7bp2axCHA.3256%40cpmsftngxa06#link1
>
>========================================
>Thank you for your patience and cooperation. If you have any questions or
>concerns, please feel free to post it in the group. I am standing by to be
>of assistance.
>Have a nice day!!
>
>Best regards,
>Jeffrey Tan
>Microsoft Online Partner Support
>Get Secure! - www.microsoft.com/security
>This posting is provided "as is" with no warranties and confers no rights.
- Next message: C# Learner: "Re: Encoding... sigh."
- Previous message: Jon Maz: "Re: How can I get Http Status Code?"
- In reply to: Jeffrey Tan[MSFT]: "RE: file system events (FileSystemWatcher)"
- Next in thread: Jeffrey Tan[MSFT]: "Re: file system events (FileSystemWatcher)"
- Reply: Jeffrey Tan[MSFT]: "Re: file system events (FileSystemWatcher)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|