It is currently Wed Feb 19, 2020 11:38 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Determine what caused dir change
PostPosted: Fri Feb 14, 2020 5:23 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Apr 18, 2019 8:17 am
Posts: 564
Hi all, using the code below, how can I tell if #FILE_NOTIFY_CHANGE_SIZE was triggered instead of #FILE_NOTIFY_CHANGE_FILE_NAME? Thanks.

Code:
Debug #FILE_NOTIFY_CHANGE_SIZE ; 8

Repeat
  Sleep_(250)
  dir=FindFirstChangeNotification_("D:\Temp\",0,#FILE_NOTIFY_CHANGE_FILE_NAME|#FILE_NOTIFY_CHANGE_SIZE)
  Repeat
    why=WaitForSingleObject_(dir,#INFINITE)
    a+1
  Until a=3
  a=0
  Debug why ; 0 (I was hoping 8)
  FindCloseChangeNotification_(dir)
ForEver


Top
 Profile  
Reply with quote  
 Post subject: Re: Determine what caused dir change
PostPosted: Fri Feb 14, 2020 7:15 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Sep 11, 2016 2:17 pm
Posts: 605
It wont wait for both or one specific event.
Quote:
A wait is satisfied when one of the filter conditions occurs in the monitored directory or subtree.

To wait for the next event call FindNextChangeNotification_(), however i didnt find a simple way to see what event specifically was triggered.


Top
 Profile  
Reply with quote  
 Post subject: Re: Determine what caused dir change
PostPosted: Fri Feb 14, 2020 7:48 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Apr 18, 2019 8:17 am
Posts: 564
It triggers on both, but I was hoping to detect which it was that triggered, without looping through and querying all the files in the folder.


Top
 Profile  
Reply with quote  
 Post subject: Re: Determine what caused dir change
PostPosted: Fri Feb 14, 2020 8:05 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Sep 11, 2016 2:17 pm
Posts: 605
ReadDirectoryChangesW migh be an option.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye