Re: file system events (FileSystemWatcher)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Allen Anderson (allen_at_sparkysystems.com)
Date: 02/11/04


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.



Relevant Pages

  • Re: Update only Xml node (PHP5)
    ... XML you cannot read and update part of an XML file directly off disk. ... You must read the whole file in memory, change part of it in memory and ... However there are database engines that do this (I've read about them ...
    (comp.lang.php)
  • Proposed Assembler Commands
    ... ACM Automatically Clear Memory ... BKCRDR Backspace Card Reader ... BKSPD Backspace Disk ... EIAO Execute In Any Order ...
    (sci.electronics.design)
  • Re: Att. Alex Nichol -VM cont.
    ... I find documentation that says a 4kb page in memory is written to the hard ... manner that a 4kb memory page is equal to a 4kb cluster written on the disk". ... So where is the basis for saying since 4kb paging in memory that 4kb clusters ...
    (microsoft.public.windowsxp.general)
  • Re: Slow performance
    ... Leaving your computer on 24/7 means that if any programme has a memory ... The Disk Defragmenter report shows you have minimal free disk space. ... select Properties, General, Advanced and check the box before Compress ... Volume fragmentation ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Slow performance
    ... I realize that the pagefile usage is excessive and I need to reduce memory ... I've never messed with those settings before. ... Peak are greatly in excess of the installed RAM. ... The Disk Defragmenter report shows you have minimal free disk space. ...
    (microsoft.public.windowsxp.perform_maintain)