Article View: borland.public.cppbuilder.nativeapi
Article #17218Re: Is FindFirstChangeNotification half blind?
From: Nick B. Cassos
Date: Thu, 03 Apr 2003 13:33
Date: Thu, 03 Apr 2003 13:33
30 lines
2147 bytes
2147 bytes
On Thu, 3 Apr 2003 12:45:53 +0200, "Peter Elbertse" <zoetjuh@wanadoo.nl> wrote: >...I created a thread to monitor the directory in which the files need to be. For this I >use the FindFirstChangeNotification API. >It works pretty good. It detects the removal of the Directory and it detects the removal of any File >within the Directory. >BUT... when I delete the Directory when it contains files, FindFirstChangeNotification doesn't >detect it. >... First of all, you should "wait" after FindFirstChangeNotification, that is, "FindNextChangeNotification" should be in the same loop as your "wait" function (and following it). Now, regarding your problem, you should try adding a FILE_NOTIFY_CHANGE_DIR_NAME to your filter and, if this doesn't work for you, you should monitor one directory higher than the one you intend to. For example: C:\Program Files\My App\Watch Dir If you don't get all notifications of "Watch Dir" (after adding the flag mentioned above), you should monitor "My App". This is the *only* way to be notified for every change that happens to "Watch Dir" (assuming your have the proper filter). -- Nick B. Cassos
Technical Details
Message-ID:
<fcdo8vgf7j2clmso8bqg0e454l0jlvvrpq@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!sn-xit-08!supernews.com!pln-w!extra.newsguy.com!lotsanews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3e8c0fa7$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,e4bd711f5b42d795 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-04-03 05:42:16 PST From: Nick B. Cassos <nbc@no_spam.ath.forthnet.gr> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Is FindFirstChangeNotification half blind? Date: Thu, 03 Apr 2003 16:33:29 +0300 Message-ID: <fcdo8vgf7j2clmso8bqg0e454l0jlvvrpq@4ax.com> References: <3e8c0fa7$1@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 213.16.153.125 X-Trace: newsgroups.borland.com 1049376805 213.16.153.125 (3 Apr 2003 05:33:25 -0800) Lines: 30 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!sn-xit-08!supernews.com!pln-w!extra.newsguy.com!lotsanews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail