Re: Getting file names "on the fly" with XP?



On Wed, 31 Aug 2005 00:39:46 +0200, "Sven Abels" <dump2@xxxxxxxxxxxx>
wrote:

>
>
>> The Win API has FindFirstChangeNotification, FindNextChangeNotification
>> and
>> WaitForSingleObject which can be used for this type of work. They are not
>> limited to XP.
>
>
>Thanks a lot for the tip!
>I was able to find a TDirectoryWatch component at
>http://www.angusj.com/delphi/
>which actually looks quite good.
>However: I cannot see a way of retrieving the actual file name / directory
>name
>that changed.
>
>
>In the component, I think that it's somewhere in the following method but
>I have no clue how to extract the file name:


I downloaded and had a look at the TDirectoryWatch code. It's a fairly
minimal implementation of a wrapper for
FindFirst/NextChangeNotification;

I'd suggest you download the old TurboPower ShellShock component set
from SourceForge, it also has a wrapper component for these APIs
(TStShellNotification) which has a much more elaborate set of events
indicating what actually happened.

HTH

Stephen Posey
slposey@xxxxxxxxxxxxxx

.



Relevant Pages

  • Re: FileSystemWatcher Created() delay
    ... It's using FindFirstChangeNotification. ... The flag options correspond ... In the API, ... The try clause would end by exiting the loop. ...
    (microsoft.public.dotnet.general)
  • Re: Automatically monitoring a file written by a 3rd party program.
    ... FindFirstChangeNotification. ... This API tells you only that a file has changed in a monitored folder. ... is writing it depends on the file sharing flags used by the other program. ... Yes, if the other program has opened the file in exclusvie mode, then it ...
    (microsoft.public.vc.mfc)