![]() |
Dateinamen herausbekommen
Moin,
ich habe mit
Delphi-Quellcode:
eine Verzeichnisüberwachung realisiert. Jetzt möchte ich aber herausbekommen welche Datei sich verändert hat. Ist das mit dem Code von oben möglich? Ich habe in der MSDN nichts dazu gefunden.
var
dwWaitStatus : DWORD; begin hNotifity := FindFirstChangeNotification(PChar(FsDirPath), true, FILE_NOTIFY_CHANGE_FILE_NAME or FILE_NOTIFY_CHANGE_LAST_WRITE or FILE_NOTIFY_CHANGE_SIZE or FILE_ACTION_ADDED or FILE_ACTION_REMOVED or FILE_ACTION_MODIFIED); if (hNotifity = INVALID_HANDLE_VALUE) then begin RaiseLastWin32Error; Terminate; end; while ((FindNextChangeNotification(hNotifity)) and (not terminated)) do begin Application.ProcessMessages; dwWaitStatus := WaitForSingleObject(hNotifity, 1000); if (dwWaitStatus = WAIT_FAILED) then begin RaiseLastWin32Error; Terminate; end; if (dwWaitStatus = WAIT_OBJECT_0) then begin AddFileToList; end; end; |
Re: Dateinamen herausbekommen
Diese Informationen bekommst du IMO nur über ReadDirectoryChangesW(). Das andere besagt nur, daß sich etwas geändert hat.
|
Re: Dateinamen herausbekommen
Hinweis bezüglich FILE_ACTION_* im NotifyFilter siehe
![]() |
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:20 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz